1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Switched setUp() to setUpTestData() where possible in Django's tests.

This commit is contained in:
Simon Charette
2018-11-23 20:59:38 -05:00
committed by Tim Graham
parent 9a7d336c38
commit 84e7a9f4a7
49 changed files with 421 additions and 334 deletions

View File

@@ -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