summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2018-03-13 19:06:40 +0100
committerGitHub <noreply@github.com>2018-03-13 19:06:40 +0100
commitacfc650f2a6e4a79e80237eabfa923ea3a05d709 (patch)
tree850083f65e949d489d669e20b88dccd78060e43d /tests
parent22bcd3a1d88add6e4cf2c4451ede8d1ae142dedd (diff)
Fixed #29199 -- Fixed crash when database user password contains @ sign on Oracle.
Thanks Shane Allgeier for the report and Tim Graham for the review.
Diffstat (limited to 'tests')
-rw-r--r--tests/backends/oracle/tests.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/backends/oracle/tests.py b/tests/backends/oracle/tests.py
index 6896419778..77de9cf279 100644
--- a/tests/backends/oracle/tests.py
+++ b/tests/backends/oracle/tests.py
@@ -57,7 +57,7 @@ class Tests(unittest.TestCase):
@unittest.skipUnless(connection.vendor == 'oracle', 'Oracle tests')
-class HiddenNoDataFoundExceptionTest(TransactionTestCase):
+class TransactionalTests(TransactionTestCase):
available_apps = ['backends']
def test_hidden_no_data_found_exception(self):
@@ -83,3 +83,16 @@ class HiddenNoDataFoundExceptionTest(TransactionTestCase):
finally:
with connection.cursor() as cursor:
cursor.execute('DROP TRIGGER "TRG_NO_DATA_FOUND"')
+
+ def test_password_with_at_sign(self):
+ old_password = connection.settings_dict['PASSWORD']
+ connection.settings_dict['PASSWORD'] = 'p@ssword'
+ try:
+ self.assertIn('/\\"p@ssword\\"@', connection._connect_string())
+ with self.assertRaises(DatabaseError) as context:
+ connection.cursor()
+ # Database exception: "ORA-01017: invalid username/password" is
+ # expected.
+ self.assertIn('ORA-01017', context.exception.args[0].message)
+ finally:
+ connection.settings_dict['PASSWORD'] = old_password