Checking resource.context in unit tests
@@ -18,11 +18,12 @@ class TestPublicResourceFlagsEndpoint(HSRESTTestCase):
self.pid = res.short_id
self.resources_to_delete.append(self.pid)
- def test_set_resoource_flag_make_public(self):
+ def test_set_resource_flag_make_public(self):
flag_url = "/hsapi/resource/%s/flag/" % self.pid
response = self.client.post(flag_url, {
"t": "make_public"
}, format='json')
+ self.assertEqual(response.context, None)
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
def test_set_resource_flag_make_private(self):
@@ -30,6 +31,7 @@ class TestPublicResourceFlagsEndpoint(HSRESTTestCase):
response = self.client.post(flag_url, {
"t": "make_private"
}, format='json')
+ self.assertEqual(response.context, None)
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
def test_set_resource_flag_make_discoverable(self):
@@ -37,6 +39,7 @@ class TestPublicResourceFlagsEndpoint(HSRESTTestCase):
response = self.client.post(flag_url, {
"t": "make_discoverable"
}, format='json')
+ self.assertEqual(response.context, None)
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
def test_set_resource_flag_make_not_discoverable(self):
@@ -44,6 +47,7 @@ class TestPublicResourceFlagsEndpoint(HSRESTTestCase):
response = self.client.post(flag_url, {
"t": "make_not_discoverable"
}, format='json')
+ self.assertEqual(response.context, None)
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
def test_set_resource_flag_make_not_shareable(self):
@@ -51,6 +55,7 @@ class TestPublicResourceFlagsEndpoint(HSRESTTestCase):
response = self.client.post(flag_url, {
"t": "make_not_shareable"
}, format='json')
+ self.assertEqual(response.context, None)
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
def test_set_resource_flag_make_shareable(self):
@@ -58,4 +63,5 @@ class TestPublicResourceFlagsEndpoint(HSRESTTestCase):
response = self.client.post(flag_url, {
"t": "make_shareable"
}, format='json')
+ self.assertEqual(response.context, None)
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
