def test_serializing_minimal_image(self): """ Check if image with minimal properties will serialize properly """ expected = { 'src': 'http://www.example.com', } image = Image(**expected) expected['type'] = 'image' self.assertEqual(expected, image.to_dict())
def test_serializing_maximum_image(self): """ Check if image with maximum properties will serialize properly """ expected = { 'alt': 'This is image', 'href': 'http://www.example.com/href', 'src': 'http://www.example.com', } image = Image(**expected) expected['type'] = 'image' self.assertEqual(expected, image.to_dict())