From 84e7a9f4a7bb3cad2bffae97baaae99de152c451 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Fri, 23 Nov 2018 20:59:38 -0500 Subject: Switched setUp() to setUpTestData() where possible in Django's tests. --- tests/validation/tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/validation') diff --git a/tests/validation/tests.py b/tests/validation/tests.py index bc23ac5808..46fe2f0c7b 100644 --- a/tests/validation/tests.py +++ b/tests/validation/tests.py @@ -83,8 +83,9 @@ class ArticleForm(forms.ModelForm): class ModelFormsTests(TestCase): - def setUp(self): - self.author = Author.objects.create(name='Joseph Kocherhans') + @classmethod + def setUpTestData(cls): + cls.author = Author.objects.create(name='Joseph Kocherhans') def test_partial_validation(self): # Make sure the "commit=False and set field values later" idiom still -- cgit v1.3