def test_programme(self): serializer = serializers.ProgrammeSerializer(self.programme, context=MOCK_CONTEXT) self.assertListEqual(serializer.data.keys(), [ 'id', 'slug', 'name', 'synopsis', 'runtime', 'photo_url', 'rss_url', 'language', 'category' ])
def test_programme_photo_url(self): serializer = serializers.ProgrammeSerializer(self.programme) self.assertEqual(serializer.data['photo'], "/media/defaults/example/radio_5.jpg")
def test_programme(self): serializer = serializers.ProgrammeSerializer(self.programme) self.assertListEqual(serializer.data.keys(), [ 'id', 'slug', 'name', 'synopsis', 'runtime', 'photo', 'language', 'category' ])
def test_programme_photo_url(self): serializer = serializers.ProgrammeSerializer(self.programme, context=MOCK_CONTEXT) self.assertEqual( serializer.data['photo_url'], "http://testserver/media/defaults/example/radio_5.jpg")