Download:
child 28:ccae9f5abc14
parent 26:17f590c312bd
27:719fe9a76f1e
Anton Shestakov <engored@ya.ru>, Fri, 11 Jan 2013 17:33:00 +0900
Testing ProjectsAndTasks resource.

1 файлов изменено, 8 вставок(+), 0 удалений(-) [+]
test.py file | annotate | diff | comparison | revisions
--- a/test.py Fri Jan 11 17:25:22 2013 +0900
+++ b/test.py Fri Jan 11 17:33:00 2013 +0900
@@ -2,6 +2,7 @@
#-*- coding:utf-8 -*-
import json
+from itertools import chain
from unittest import TestCase, main
from app import app, init_db
@@ -26,6 +27,7 @@
resource_type = ''
list_url = ''
item_url = ''
+ all_url = '/%s/all/'
def create_resource(self):
url = self.list_url % self.workspace
@@ -56,6 +58,12 @@
data = json.loads(response.data)
self.assertTrue(any(resource.get('_id', None) == resource_id for resource in data))
+
+ url = self.all_url % self.workspace
+ response = self.c.get(url)
+ data = json.loads(response.data)
+
+ self.assertTrue(any(resource.get('_id', None) == resource_id for resource in chain(*data.values())))
def update_resource(self, resource_id):
url = self.item_url % (self.workspace, resource_id)