示例#1
0
 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
示例#2
0
 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
示例#3
0
 def serializer(self, item=None, **context):
     if not item:
         return FeedItemSerializer(context=context)
     return FeedItemSerializer(item, context=context)