Esempio n. 1
0
 def test_with_price(self):
     app = mkt.site.tests.app_factory()
     self.make_premium(app)
     collection = self.feed_collection_factory(app_ids=[app.id])
     data = serializers.FeedCollectionSerializer(collection,
                                                 context=self.context).data
     eq_(data['apps'][0]['price'], '1.00')
Esempio n. 2
0
 def test_with_price(self):
     app = amo.tests.app_factory()
     self.make_premium(app)
     coll = self.feed_collection_factory(app_ids=[app.id])
     data = serializers.FeedCollectionSerializer(coll, context={
         'request': amo.tests.req_factory_factory('',
                                                  REGION=mkt.regions.US)
     }).data
     eq_(data['apps'][0]['price'], 1)
Esempio n. 3
0
 def validate(self):
     return (serializers.FeedCollectionSerializer(
         data=self.data).validate_color(self.data.get('color')))
Esempio n. 4
0
 def validate(self, **attrs):
     return (serializers.FeedCollectionSerializer()
             .validate_background_color(attrs=self.data,
                                        source='background_color'))