From f0aabcca43c7302d706aa11dda4847294eb09f93 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 22 Mar 2013 14:55:55 -0400 Subject: [PATCH] Add a test to show you cannot put to a subresource collection URL --- lib/main/tests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/main/tests.py b/lib/main/tests.py index 2a9f6a958b..749be872dd 100644 --- a/lib/main/tests.py +++ b/lib/main/tests.py @@ -342,7 +342,15 @@ class OrganizationsTest(BaseTest): self.post(urls[1], new_data1, expect=405, auth=self.get_super_credentials()) def test_put_item_subobjects_projects(self): - pass + + # any attempt to put a subobject should be a 405, edit the actual resource or POST with 'disassociate' to delete + + orgs = self.get(self.collection(), expect=200, auth=self.get_super_credentials()) + projects0_url = orgs['results'][0]['related']['projects'] + sub_projects = self.get(projects0_url, expect=200, auth=self.get_super_credentials()) + self.assertEquals(sub_projects['count'], 3) + first_sub_project = sub_projects['results'][0] + self.put(projects0_url, first_sub_project, expect=405, auth=self.get_super_credentials()) def test_put_item_subobjects_users(self): pass