diff options
author | Tim Graham <timograham@gmail.com> | 2015-07-06 16:17:56 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-07-06 16:17:56 -0400 |
commit | 6bd8462380e1c078969867d9a0f4871fcdbe52b4 (patch) | |
tree | c624800841b46353902eb73b873d9c79b012486c /tests/dbshell | |
parent | bc98bc56a52860688ea0ae2ec7b9e59ddb72a811 (diff) | |
download | django-6bd8462380e1c078969867d9a0f4871fcdbe52b4.tar.gz |
Refs #23658 -- Fixed dbshell tests on Windows.
Diffstat (limited to 'tests/dbshell')
-rw-r--r-- | tests/dbshell/test_postgresql_psycopg2.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/dbshell/test_postgresql_psycopg2.py b/tests/dbshell/test_postgresql_psycopg2.py index c270de3041..0bb8721b70 100644 --- a/tests/dbshell/test_postgresql_psycopg2.py +++ b/tests/dbshell/test_postgresql_psycopg2.py @@ -24,7 +24,7 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase): self.subprocess_args = list(*args) if 'PGPASSFILE' in os.environ: with open(os.environ['PGPASSFILE'], 'rb') as f: - self.pgpass = f.read() + self.pgpass = f.read().strip() # ignore line endings else: self.pgpass = None return 0 @@ -44,7 +44,7 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase): 'PORT': 444, }), ( ['psql', '-U', 'someuser', '-h', 'somehost', '-p', '444', 'dbname'], - b'somehost:444:dbname:someuser:somepassword\n', + b'somehost:444:dbname:someuser:somepassword', ) ) @@ -71,7 +71,7 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase): 'PORT': 444, }), ( ['psql', '-U', 'some:user', '-h', '::1', '-p', '444', 'dbname'], - b'\\:\\:1:444:dbname:some\\:user:some\\:password\n', + b'\\:\\:1:444:dbname:some\\:user:some\\:password', ) ) @@ -85,7 +85,7 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase): 'PORT': 444, }), ( ['psql', '-U', 'some\\user', '-h', 'somehost', '-p', '444', 'dbname'], - b'somehost:444:dbname:some\\\\user:some\\\\password\n', + b'somehost:444:dbname:some\\\\user:some\\\\password', ) ) @@ -98,7 +98,7 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase): username_str = force_str(username, encoding) password_str = force_str(password, encoding) pgpass_bytes = force_bytes( - 'somehost:444:dbname:%s:%s\n' % (username, password), + 'somehost:444:dbname:%s:%s' % (username, password), encoding=encoding, ) except UnicodeEncodeError: |