MCPcopy
hub / github.com/django/django / setUpTestData

Method setUpTestData

tests/admin_views/test_multidb.py:46–58  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 3

BookClass · 0.70
create_superuserMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected