Add support for related resources, and all present related resources on the organization object.

Implementation of sub services still on deck.
This commit is contained in:
Michael DeHaan
2013-03-21 15:11:47 -04:00
parent f8e57ddd3b
commit 0fa9255ab1
4 changed files with 104 additions and 12 deletions

View File

@@ -143,7 +143,12 @@ class OrganizationsTest(BaseTest):
# superuser credentials == 200, full list
data = self.get(self.collection(), expect=200, auth=self.get_super_credentials())
self.check_pagination_and_size(data, 10, previous=None, next=None)
[self.assertTrue(key in data['results'][0]) for key in ['name', 'description', 'url' ]]
[self.assertTrue(key in data['results'][0]) for key in ['name', 'description', 'url', 'creation_date', 'id' ]]
# check that the related URL functionality works
related = data['results'][0]['related']
for x in [ 'audit_trail', 'projects', 'users', 'admins', 'tags' ]:
self.assertTrue(x in related and related[x].endswith("/%s/" % x), "looking for %s in related" % x)
# normal credentials == 200, get only organizations that I am actually added to (there are 2)
data = self.get(self.collection(), expect=200, auth=self.get_normal_credentials())
@@ -180,13 +185,18 @@ class OrganizationsTest(BaseTest):
def test_get_item_subobjects_projects(self):
pass
def test_get_item_subobjects_users(self):
pass
def test_get_item_subobjects_admins(self):
pass
def test_get_item_subobjects_tags(self):
pass
def test_get_item_subobjects_audit_trail(self):
pass
def test_post_item(self):
new_org = dict(name='magic test org', description='8675309')
@@ -215,6 +225,12 @@ class OrganizationsTest(BaseTest):
def test_post_item_subobjects_admins(self):
pass
def test_post_item_subobjects_tags(self):
pass
def test_post_item_subobjects_audit_trail(self):
pass
def test_put_item(self):
# first get some urls and data to put back to them