Skip to content

Commit fc8af0a

Browse files
committed
Add extra model type asserts for deserialization tests
1 parent a2c8e60 commit fc8af0a

File tree

6 files changed

+7
-0
lines changed

6 files changed

+7
-0
lines changed

tests/testapp/test_bit1_field.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def test_loading(self):
9595
objs = list(serializers.deserialize("json", test_data))
9696
assert len(objs) == 1
9797
instance = objs[0].object
98+
assert isinstance(instance, Bit1Model)
9899
assert not instance.flag_a
99100
assert instance.flag_b
100101

@@ -180,6 +181,7 @@ def test_loading(self):
180181
objs = list(serializers.deserialize("json", test_data))
181182
assert len(objs) == 1
182183
instance = objs[0].object
184+
assert isinstance(instance, NullBit1Model)
183185
assert instance.flag is None
184186

185187
else:

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)