Exemple #1
0
 def test_background_image(self):
     self.shelf.update(image_hash='LOL', image_landing_hash='ROFL')
     self.data_es = self.shelf.get_indexer().extract_document(
         None, obj=self.shelf)
     data = serializers.FeedShelfESSerializer(self.data_es,
                                              context=self.context).data
     assert data['background_image'].endswith('image.png?LOL')
     assert data['background_image_landing'].endswith(
         'image_landing.png?ROFL')
Exemple #2
0
 def test_deserialize(self):
     data = serializers.FeedShelfESSerializer(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['carrier'], 'telefonica')
     eq_(data['region'], 'restofworld')
     eq_(data['description']['de'], 'test')
     eq_(data['name']['en-US'], 'test')
     return data
Exemple #3
0
 def test_background_image(self):
     self.shelf.update(image_hash='LOL', image_landing_hash='ROFL')
     self.data_es = self.shelf.get_indexer().extract_document(
         None, obj=self.shelf)
     data = serializers.FeedShelfESSerializer(self.data_es, context={
         'app_map': self.app_map,
         'request': amo.tests.req_factory_factory('')
     }).data
     assert data['background_image'].endswith('image.png?LOL')
     assert data['background_image_landing'].endswith(
         'image_landing.png?ROFL')
 def test_deserialize(self):
     data = serializers.FeedShelfESSerializer(
         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['carrier'], 'telefonica')
     eq_(data['region'], 'restofworld')
     eq_(data['description']['de'], 'test')
     eq_(data['name']['en-US'], 'test')