File tree Expand file tree Collapse file tree 2 files changed +21
-18
lines changed Expand file tree Collapse file tree 2 files changed +21
-18
lines changed Original file line number Diff line number Diff line change 88from django .conf import settings
99from django .db import DEFAULT_DB_ALIAS , connection , connections , transaction
1010from django .db .backends .postgresql .base import DatabaseWrapper as PsycopgDatabaseWrapper
11- from django .db .backends .postgresql .client import DatabaseClient as PsycopgDatabaseClient
1211from django .db .migrations .executor import MigrationExecutor
1312
1413
Original file line number Diff line number Diff line change 1414 get_pg_notify_params ,
1515 migrations_are_complete ,
1616 psycopg_kwargs_from_settings_dict ,
17- psycopg_conn_string_from_settings_dict
17+ psycopg_conn_string_from_settings_dict ,
1818)
1919
2020
@@ -92,22 +92,26 @@ def test_psycopg_kwargs_from_settings_dict(self):
9292
9393 def test_listener_string_production (self ):
9494 "This is a test to correspond to PG_NOTIFY_DSN_SERVER type settings in eda-server"
95- args = psycopg_conn_string_from_settings_dict ({
96- "ENGINE" : "django.db.backends.postgresql" ,
97- "HOST" : "127.0.0.1" ,
98- "PORT" : 5432 ,
99- "USER" : "postgres" ,
100- "PASSWORD" : "DB_PASSWORD" ,
101- "NAME" : "eda" ,
102- "TIME_ZONE" : settings .DATABASES ['default' ]['TIME_ZONE' ],
103- "OPTIONS" : {
104- "sslmode" : "allow" ,
105- "sslcert" : "" ,
106- "sslkey" : "" ,
107- "sslrootcert" : "" ,
108- },
109- })
110- assert args == "dbname=eda sslmode=allow sslcert='' sslkey='' sslrootcert='' client_encoding=UTF8 user=postgres password=DB_PASSWORD host=127.0.0.1 port=5432"
95+ args = psycopg_conn_string_from_settings_dict (
96+ {
97+ "ENGINE" : "django.db.backends.postgresql" ,
98+ "HOST" : "127.0.0.1" ,
99+ "PORT" : 5432 ,
100+ "USER" : "postgres" ,
101+ "PASSWORD" : "DB_PASSWORD" ,
102+ "NAME" : "eda" ,
103+ "TIME_ZONE" : settings .DATABASES ['default' ]['TIME_ZONE' ],
104+ "OPTIONS" : {
105+ "sslmode" : "allow" ,
106+ "sslcert" : "" ,
107+ "sslkey" : "" ,
108+ "sslrootcert" : "" ,
109+ },
110+ }
111+ )
112+ assert args == (
113+ "dbname=eda sslmode=allow sslcert='' sslkey='' sslrootcert='' client_encoding=UTF8 user=postgres password=DB_PASSWORD host=127.0.0.1 port=5432"
114+ )
111115
112116 def test_listener_string_production_use (self ):
113117 "This assures that the data we get for the connection string is usable, and demos how to use"
You can’t perform that action at this time.
0 commit comments