From 69603b3e71d1a7e4e216b313ff789384c84ce99e Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Fri, 26 Oct 2018 04:37:41 +0500 Subject: [2.1.x] Fixed #29827 -- Fixed reuse of test databases with --keepdb on MySQL. Regression in e1253bc26facfa1d0fca161f43925e99c2591ced. Backport of 9a88c6dd6aa84a1b35e585faa0058a0996cc7ed7 from master. --- tests/backends/mysql/test_creation.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') 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() -- cgit v1.3