Refactoring

This commit is contained in:
reverend 2020-09-13 12:39:46 +02:00
parent 7e4c5dcf24
commit 6b00452830
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
from django.test import Client
class ViewTestCase:
class ViewTestCaseMixin:
view = None
def setUp(self):

View File

@ -10,9 +10,9 @@ from lostplaces_app.views import (
PlaceListView
)
from lostplaces_app.forms import PlaceImageCreateForm, PlaceForm
from lostplaces_app.tests.views import ViewTestCase
from lostplaces_app.tests.views import ViewTestCaseMixin
class TestPlaceCreateView(ViewTestCase, TestCase):
class TestPlaceCreateView(ViewTestCaseMixin, TestCase):
view = PlaceCreateView
@ -42,7 +42,7 @@ class TestPlaceCreateView(ViewTestCase, TestCase):
self.assertHasForm(response, 'place_image_form', PlaceImageCreateForm)
self.assertHasForm(response, 'place_form', PlaceForm)
class TestPlaceListView(ViewTestCase, TestCase):
class TestPlaceListView(ViewTestCaseMixin, TestCase):
view = PlaceListView
@classmethod