Skip to content

Commit

Permalink
Don't require setting empty dict in functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oxan committed Aug 21, 2023
1 parent 99a8471 commit d275d6d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

# noinspection PyUnresolvedReferences
class FunctionalTestMixin:
representation_readonly = {}

def test_serialize(self):
serializer = self.serializer(instance=self.instance)
self.assertDictEqual(serializer.data, {**self.representation, **self.representation_readonly})
Expand Down Expand Up @@ -65,7 +67,6 @@ class PetTest(TestCase, FunctionalTestMixin):
serializer = PetSerializer
instance = Pet(animal='cat', name='Milo')
representation = {'animal': 'cat', 'name': 'Milo', 'weight': None}
representation_readonly = {}

# Testcase 2 (union types)

Expand Down Expand Up @@ -101,7 +102,6 @@ class BuildingTest(TestCase, FunctionalTestMixin):
'species': 'oak',
}
}
representation_readonly = {}

# Testcase 3 (complicated fields and nesting)

Expand Down Expand Up @@ -265,7 +265,6 @@ class ObscureFeaturesTest(TestCase, FunctionalTestMixin):
representation = {
'name': 'Bob'
}
representation_readonly = {}

def setUp(self):
self.instance.name = 'Bob'

0 comments on commit d275d6d

Please sign in to comment.