Skip to content
Snippets Groups Projects
Commit b1271039 authored by Deaktivert bruker's avatar Deaktivert bruker
Browse files

greg.tests: make PersonTestData inherit from GregAPITestCase

PersonTestData.setUp() calls super().setUp(), but this is only
available on GregAPITestCase.  This only works at runtime because
PersonTestData and GregAPITestCase is composed together with
multi-inheritance as part of PersonAPITestCase.

This change is obviously not ideal, but we will change it soon when
introducing pytest anyway.  This is just to get the lints passing.

Fixes: GREG-16
parent 97c97eec
No related branches found
No related tags found
1 merge request!8build: introduce pylint, pyproject.toml, and formatting lints
......@@ -22,7 +22,7 @@ class GregAPITestCase(APITestCase):
return client
class PersonTestData:
class PersonTestData(GregAPITestCase):
def setUp(self):
super().setUp()
self.person_foo_data = dict(
......@@ -43,7 +43,7 @@ class PersonTestData:
self.person_bar = Person.objects.create(**self.person_bar_data)
class PersonAPITestCase(PersonTestData, GregAPITestCase):
class PersonAPITestCase(PersonTestData):
def test_get_person(self):
url = reverse("person-detail", kwargs={"id": self.person_foo.id})
response = self.client.get(url)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment