diff options
Diffstat (limited to 'tests/auth_tests/test_admin_multidb.py')
| -rw-r--r-- | tests/auth_tests/test_admin_multidb.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/auth_tests/test_admin_multidb.py b/tests/auth_tests/test_admin_multidb.py index 6b36b50a16..f86ea86dd8 100644 --- a/tests/auth_tests/test_admin_multidb.py +++ b/tests/auth_tests/test_admin_multidb.py @@ -42,11 +42,12 @@ class MultiDatabaseTests(TestCase): @mock.patch('django.contrib.auth.admin.transaction') def test_add_view(self, mock): for db in connections: - Router.target_db = db - self.client.force_login(self.superusers[db]) - self.client.post(reverse('test_adminsite:auth_user_add'), { - 'username': 'some_user', - 'password1': 'helloworld', - 'password2': 'helloworld', - }) - mock.atomic.assert_called_with(using=db) + with self.subTest(db_connection=db): + Router.target_db = db + self.client.force_login(self.superusers[db]) + self.client.post(reverse('test_adminsite:auth_user_add'), { + 'username': 'some_user', + 'password1': 'helloworld', + 'password2': 'helloworld', + }) + mock.atomic.assert_called_with(using=db) |
