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

Method setUpTestData

tests/admin_views/tests.py:5755–5768  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

5753class AdminInlineFileUploadTest(TestCase):
5754 @classmethod
5755 def setUpTestData(cls):
5756 cls.superuser = User.objects.create_superuser(
5757 username="super", password="secret", email="super@example.com"
5758 )
5759 file1 = tempfile.NamedTemporaryFile(suffix=".file1")
5760 file1.write(b"a" * (2**21))
5761 filename = file1.name
5762 file1.close()
5763 cls.gallery = Gallery.objects.create(name="Test Gallery")
5764 cls.picture = Picture.objects.create(
5765 name="Test Picture",
5766 image=filename,
5767 gallery=cls.gallery,
5768 )
5769
5770 def setUp(self):
5771 self.client.force_login(self.superuser)

Callers

nothing calls this directly

Calls 4

create_superuserMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected