diff options
Diffstat (limited to 'tests/custom_columns/tests.py')
-rw-r--r-- | tests/custom_columns/tests.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/custom_columns/tests.py b/tests/custom_columns/tests.py index f5dfd9c0cd..874b024050 100644 --- a/tests/custom_columns/tests.py +++ b/tests/custom_columns/tests.py @@ -6,13 +6,14 @@ from .models import Article, Author class CustomColumnsTests(TestCase): - def setUp(self): - self.a1 = Author.objects.create(first_name="John", last_name="Smith") - self.a2 = Author.objects.create(first_name="Peter", last_name="Jones") - self.authors = [self.a1, self.a2] - - self.article = Article.objects.create(headline="Django lets you build Web apps easily", primary_author=self.a1) - self.article.authors.set(self.authors) + @classmethod + def setUpTestData(cls): + cls.a1 = Author.objects.create(first_name="John", last_name="Smith") + cls.a2 = Author.objects.create(first_name="Peter", last_name="Jones") + cls.authors = [cls.a1, cls.a2] + + cls.article = Article.objects.create(headline="Django lets you build Web apps easily", primary_author=cls.a1) + cls.article.authors.set(cls.authors) def test_query_all_available_authors(self): self.assertQuerysetEqual( |