Refs #25050 -- Corrected test assertion in serializers test.

This commit is contained in:
Tim Graham 2015-07-03 08:03:20 -04:00
parent a570701e02
commit c0c7fa4837
1 changed files with 3 additions and 1 deletions

View File

@ -229,7 +229,9 @@ class SerializersTestBase(object):
author = Author.objects.defer('name').get(pk=author.pk) author = Author.objects.defer('name').get(pk=author.pk)
serial_str = serializers.serialize(self.serializer_name, [author]) serial_str = serializers.serialize(self.serializer_name, [author])
deserial_objs = list(serializers.deserialize(self.serializer_name, serial_str)) deserial_objs = list(serializers.deserialize(self.serializer_name, serial_str))
self.assertIsInstance(deserial_objs[0].object, Author) # Check the class instead of using isinstance() because model instances
# with deferred fields (e.g. Author_Deferred_name) will pass isinstance.
self.assertEqual(deserial_objs[0].object.__class__, Author)
def test_custom_field_serialization(self): def test_custom_field_serialization(self):
"""Tests that custom fields serialize and deserialize intact""" """Tests that custom fields serialize and deserialize intact"""