Skip to content

Commit d41f60a

Browse files
committed
Minor linter stuff
1 parent 0c7d4c3 commit d41f60a

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

ansible_base/lib/utils/db.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from django.conf import settings
99
from django.db import DEFAULT_DB_ALIAS, connection, connections, transaction
1010
from django.db.backends.postgresql.base import DatabaseWrapper as PsycopgDatabaseWrapper
11-
from django.db.backends.postgresql.client import DatabaseClient as PsycopgDatabaseClient
1211
from django.db.migrations.executor import MigrationExecutor
1312

1413

test_app/tests/lib/utils/test_db.py

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
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"

0 commit comments

Comments
 (0)