Commit e10546ae authored by Łukasz Nowak's avatar Łukasz Nowak

Check result w/o cache.

Cache for list is not implemented and in order to avoid hiding other problems
provide no cache variant of test.
parent 7ce4582e
...@@ -1148,7 +1148,8 @@ class TestInstanceGETlist(VifibSlaposRestAPIV1InstanceMixin): ...@@ -1148,7 +1148,8 @@ class TestInstanceGETlist(VifibSlaposRestAPIV1InstanceMixin):
.bobobase_modification_time()) .bobobase_modification_time())
self.assertEqual(calculated, self.response.getheader('Last-Modified')) self.assertEqual(calculated, self.response.getheader('Last-Modified'))
def test(self): def test_no_cache(self):
# version of test which ignores cache to expose possible other errors
self.connection.request(method='GET', self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance']), url='/'.join([self.api_path, 'instance']),
headers={'REMOTE_USER': self.customer_reference}) headers={'REMOTE_USER': self.customer_reference})
...@@ -1156,14 +1157,17 @@ class TestInstanceGETlist(VifibSlaposRestAPIV1InstanceMixin): ...@@ -1156,14 +1157,17 @@ class TestInstanceGETlist(VifibSlaposRestAPIV1InstanceMixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(200) self.assertResponseCode(200)
self.assertResponseJson() self.assertResponseJson()
self.assertLastModifiedHeader()
self.assertCacheControlHeader()
self.assertEqual({ self.assertEqual({
"list": ['/'.join([self.api_url, 'instance', "list": ['/'.join([self.api_url, 'instance',
self.software_instance.getRelativeUrl()])] self.software_instance.getRelativeUrl()])]
}, },
self.json_response) self.json_response)
def test(self):
self.test_no_cache()
self.assertLastModifiedHeader()
self.assertCacheControlHeader()
def test_if_modified_since_equal(self): def test_if_modified_since_equal(self):
self.connection.request(method='GET', self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance']), url='/'.join([self.api_path, 'instance']),
......
76 77
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment