--- a/test.py Tue Jul 19 14:55:13 2016 +0800
+++ b/test.py Tue Jul 19 17:44:31 2016 +0800
response = self.c.get(url)
data = json.loads(response.data)
- self.assertTrue(any(resource.get('_id', None) == resource_id for resource in data))
+ self.assertIn(resource_id, [resource['_id'] for resource in data])
url = self.all_url % self.workspace
response = self.c.get(url)
data = json.loads(response.data)
+ combined = chain(*data.values())
- self.assertTrue(any(resource.get('_id', None) == resource_id for resource in chain(*data.values())))
+ self.assertIn(resource_id, [resource['_id'] for resource in combined])
def update_resource(self, resource_id):
url = self.item_url % (self.workspace, resource_id)