diff options
Diffstat (limited to 'tests/auth_tests/test_admin_multidb.py')
| -rw-r--r-- | tests/auth_tests/test_admin_multidb.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/auth_tests/test_admin_multidb.py b/tests/auth_tests/test_admin_multidb.py index 5849ef98e5..fac2c0fc7e 100644 --- a/tests/auth_tests/test_admin_multidb.py +++ b/tests/auth_tests/test_admin_multidb.py @@ -3,7 +3,6 @@ from unittest import mock from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User -from django.db import connections from django.test import TestCase, override_settings from django.urls import path, reverse @@ -32,7 +31,7 @@ class MultiDatabaseTests(TestCase): @classmethod def setUpTestData(cls): cls.superusers = {} - for db in connections: + for db in cls.databases: Router.target_db = db cls.superusers[db] = User.objects.create_superuser( username='admin', password='something', email='test@test.org', @@ -40,7 +39,7 @@ class MultiDatabaseTests(TestCase): @mock.patch('django.contrib.auth.admin.transaction') def test_add_view(self, mock): - for db in connections: + for db in self.databases: with self.subTest(db_connection=db): Router.target_db = db self.client.force_login(self.superusers[db]) |
