summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-09-12 10:16:49 +0200
committerClaude Paroz <claude@2xlibre.net>2012-09-12 10:16:49 +0200
commit859aa2a6c4496a0feafebef7c7ea8fc57d9913f4 (patch)
tree7b9b29da14ff702fbac5a93071462f69a231607c /tests
parent0133d66734f5b0470436a22f5b85bdf7266bf1cf (diff)
Fixed #18790 -- Encoded database password on Python 2
Thanks thcourbon@gmail.com for the report.
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/backends/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py
index e53b02032e..cfa298253c 100644
--- a/tests/regressiontests/backends/tests.py
+++ b/tests/regressiontests/backends/tests.py
@@ -401,6 +401,19 @@ class BackendTestCase(TestCase):
self.assertEqual(list(cursor.fetchmany(2)), [('Jane', 'Doe'), ('John', 'Doe')])
self.assertEqual(list(cursor.fetchall()), [('Mary', 'Agnelline'), ('Peter', 'Parker')])
+ def test_unicode_password(self):
+ old_password = connection.settings_dict['PASSWORD']
+ connection.settings_dict['PASSWORD'] = "françois"
+ try:
+ cursor = connection.cursor()
+ except backend.Database.DatabaseError:
+ # As password is probably wrong, a database exception is expected
+ pass
+ except Exception as e:
+ self.fail("Unexpected error raised with unicode password: %s" % e)
+ finally:
+ connection.settings_dict['PASSWORD'] = old_password
+
def test_database_operations_helper_class(self):
# Ticket #13630
self.assertTrue(hasattr(connection, 'ops'))