diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2018-10-26 04:37:41 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-10-25 19:38:00 -0400 |
| commit | 69603b3e71d1a7e4e216b313ff789384c84ce99e (patch) | |
| tree | b724882bf6f6e702ce2c0332173ff96dc9fc47a3 /tests | |
| parent | 4529287af24899a8b09c5cba9bd4ab156a03f0ba (diff) | |
[2.1.x] Fixed #29827 -- Fixed reuse of test databases with --keepdb on MySQL.
Regression in e1253bc26facfa1d0fca161f43925e99c2591ced.
Backport of 9a88c6dd6aa84a1b35e585faa0058a0996cc7ed7 from master.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/backends/mysql/test_creation.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/backends/mysql/test_creation.py b/tests/backends/mysql/test_creation.py index e3a83346fe..2f6351d9bc 100644 --- a/tests/backends/mysql/test_creation.py +++ b/tests/backends/mysql/test_creation.py @@ -43,3 +43,10 @@ class DatabaseCreationTests(SimpleTestCase): with self.patch_test_db_creation(self._execute_raise_access_denied): with self.assertRaises(SystemExit): creation._create_test_db(verbosity=0, autoclobber=False, keepdb=False) + + def test_clone_test_db_database_exists(self): + creation = DatabaseCreation(connection) + with self.patch_test_db_creation(self._execute_raise_database_exists): + with mock.patch.object(DatabaseCreation, '_clone_db') as _clone_db: + creation._clone_test_db('suffix', verbosity=0, keepdb=True) + _clone_db.assert_not_called() |
