示例#1
0
 def test_background_image(self):
     self.collection.update(type=feed.COLLECTION_PROMO, image_hash='LOL')
     self.data_es = self.collection.get_indexer().extract_document(
         None, obj=self.collection)
     data = serializers.FeedCollectionESSerializer(
         self.data_es, context=self.context).data
     assert data['background_image'].endswith('image.png?LOL')
示例#2
0
 def test_deserialize(self):
     data = serializers.FeedCollectionESSerializer(
         self.data_es, context=self.context).data
     self.assertSetEqual([app['id'] for app in data['apps']],
                         [app.id for app in self.apps])
     eq_(data['description']['de'], 'test')
     eq_(data['name']['en-US'], 'test')
     return data
示例#3
0
 def test_deserialize(self):
     data = serializers.FeedCollectionESSerializer(self.data_es, context={
         'app_map': self.app_map,
         'request': amo.tests.req_factory_factory('')
     }).data
     self.assertSetEqual([app['id'] for app in data['apps']],
                         [app.id for app in self.apps])
     eq_(data['description']['de'], 'test')
     eq_(data['name']['en-US'], 'test')
     return data