Beispiel #1
0
 def test_region_handles_worldwide(self):
     data = {
         'region': 'worldwide',
         'item_type': 'app',
         'app': self.feedapps[0].id,
     }
     serializer = serializers.FeedItemSerializer(data=data)
     assert serializer.is_valid()
     assert serializer.validated_data['region'] == RESTOFWORLD.id
Beispiel #2
0
 def serializer(self, data=None, item=None):
     if not item:
         return serializers.FeedItemSerializer(data=data,
                                               context=self.context)
     return serializers.FeedItemSerializer(instance=item,
                                           context=self.context)
Beispiel #3
0
 def serializer(self, item=None, **context):
     if not item:
         return serializers.FeedItemSerializer(context=context)
     return serializers.FeedItemSerializer(item, context=context)