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')
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)
def validate(self): return (serializers.FeedCollectionSerializer( data=self.data).validate_color(self.data.get('color')))
def validate(self, **attrs): return (serializers.FeedCollectionSerializer() .validate_background_color(attrs=self.data, source='background_color'))