Skip to content

Commit 6d8fa46

Browse files
committed
Add extra model type asserts for deserialization tests
1 parent c796a86 commit 6d8fa46

File tree

6 files changed

+6
-0
lines changed

6 files changed

+6
-0
lines changed

tests/testapp/test_bit1_field.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def test_loading(self):
9292
objs = list(serializers.deserialize("json", test_data))
9393
assert len(objs) == 1
9494
instance = objs[0].object
95+
assert isinstance(instance, Bit1Model)
9596
assert not instance.flag_a
9697
assert instance.flag_b
9798

tests/testapp/test_dynamicfield.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ def test_dumping(self):
495495
def test_loading(self):
496496
deserialized = list(serializers.deserialize("json", self.test_data))
497497
instance = deserialized[0].object
498+
assert isinstance(instance, DynamicModel)
498499
assert instance.attrs == {"a": "b"}
499500

500501

tests/testapp/test_listcharfield.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ def test_loading(self):
567567
"""
568568
objs = list(serializers.deserialize("json", test_data))
569569
instance = objs[0].object
570+
assert isinstance(instance, CharListModel)
570571
assert instance.field == ["big", "leather", "comfy"]
571572

572573

tests/testapp/test_listtextfield.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ def test_loading(self):
358358
"""
359359
objs = list(serializers.deserialize("json", test_data))
360360
instance = objs[0].object
361+
assert isinstance(instance, BigCharListModel)
361362
assert instance.field == ["big", "leather", "comfy"]
362363

363364
def test_dumping_loading_empty(self):

tests/testapp/test_setcharfield.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ def test_loading(self):
543543
"""
544544
objs = list(serializers.deserialize("json", test_data))
545545
instance = objs[0].object
546+
assert isinstance(instance, CharSetModel)
546547
assert instance.field == {"big", "leather", "comfy"}
547548

548549

tests/testapp/test_settextfield.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ def test_loading(self):
336336
"""
337337
objs = list(serializers.deserialize("json", test_data))
338338
instance = objs[0].object
339+
assert isinstance(instance, BigCharSetModel)
339340
assert instance.field == {"big", "leather", "comfy"}
340341

341342
def test_empty(self):

0 commit comments

Comments
 (0)