(cls)
| 44 | |
| 45 | @classmethod |
| 46 | def setUpTestData(cls): |
| 47 | cls.superusers = {} |
| 48 | cls.test_book_ids = {} |
| 49 | for db in cls.databases: |
| 50 | Router.target_db = db |
| 51 | cls.superusers[db] = User.objects.create_superuser( |
| 52 | username="admin", |
| 53 | password="something", |
| 54 | email="test@test.org", |
| 55 | ) |
| 56 | b = Book(name="Test Book") |
| 57 | b.save(using=db) |
| 58 | cls.test_book_ids[db] = b.id |
| 59 | |
| 60 | def tearDown(self): |
| 61 | # Reset the routers' state between each test. |
nothing calls this directly
no test coverage detected