summaryrefslogtreecommitdiff
path: root/tests/modeladmin
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2018-11-23 20:59:38 -0500
committerTim Graham <timograham@gmail.com>2018-11-27 09:35:17 -0500
commit84e7a9f4a7bb3cad2bffae97baaae99de152c451 (patch)
treec81eeb6edf47ce0abdb7551cd28a3de354dfd20f /tests/modeladmin
parent9a7d336c3866c5226ed11868be0234c7e2fa47fa (diff)
downloaddjango-84e7a9f4a7bb3cad2bffae97baaae99de152c451.tar.gz
Switched setUp() to setUpTestData() where possible in Django's tests.
Diffstat (limited to 'tests/modeladmin')
-rw-r--r--tests/modeladmin/test_has_add_permission_obj_deprecation.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/modeladmin/test_has_add_permission_obj_deprecation.py b/tests/modeladmin/test_has_add_permission_obj_deprecation.py
index f5489a41db..17bbacc1fe 100644
--- a/tests/modeladmin/test_has_add_permission_obj_deprecation.py
+++ b/tests/modeladmin/test_has_add_permission_obj_deprecation.py
@@ -81,9 +81,12 @@ class BandAdmin(ModelAdmin):
class ModelAdminTests(TestCase):
+ @classmethod
+ def setUpTestData(cls):
+ cls.band = Band.objects.create(name='The Doors', bio='', sign_date=date(1965, 1, 1))
+ cls.song = Song.objects.create(name='test', band=cls.band)
+
def setUp(self):
- self.band = Band.objects.create(name='The Doors', bio='', sign_date=date(1965, 1, 1))
- self.song = Song.objects.create(name='test', band=self.band)
self.site = AdminSite()
self.request = MockRequest()
self.request.user = self.MockAddUser()