def test_region_handles_worldwide(self): data = { 'region': 'worldwide', 'item_type': 'collection', 'collection': self.collection.id, } serializer = FeedItemSerializer(data=data) assert serializer.is_valid() assert serializer.object.region == RESTOFWORLD.id
def test_region_handles_worldwide(self): data = { 'region': 'worldwide', 'item_type': 'app', 'app': self.feedapps[0].id, } serializer = FeedItemSerializer(data=data) assert serializer.is_valid() assert serializer.object.region == RESTOFWORLD.id
def serializer(self, item=None, **context): if not item: return FeedItemSerializer(context=context) return FeedItemSerializer(item, context=context)