Fixed #29827 -- Fixed reuse of test databases with --keepdb on MySQL.

Regression in e1253bc26f.
This commit is contained in:
Sergey Fedoseev 2018-10-26 04:37:41 +05:00 committed by Tim Graham
parent 76b3367035
commit 9a88c6dd6a
3 changed files with 16 additions and 11 deletions

View file

@ -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()