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

Check Cache-Control header.

parent 77a41023
...@@ -470,6 +470,9 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin): ...@@ -470,6 +470,9 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin):
calculated = rfc1123_date(self.software_instance.getModificationDate()) calculated = rfc1123_date(self.software_instance.getModificationDate())
self.assertEqual(calculated, self.response.getheader('Last-Modified')) self.assertEqual(calculated, self.response.getheader('Last-Modified'))
def assertCacheControlHeader(self):
self.assertEqual('public', self.response.getheader('Cache-Control'))
def test_non_existing(self): def test_non_existing(self):
non_existing = 'software_instance_module/' + self.generateNewId() non_existing = 'software_instance_module/' + self.generateNewId()
try: try:
...@@ -518,6 +521,7 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin): ...@@ -518,6 +521,7 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(200) self.assertResponseCode(200)
self.assertLastModifiedHeader() self.assertLastModifiedHeader()
self.assertCacheControlHeader()
self.assertResponseJson() self.assertResponseJson()
self.assertEqual({ self.assertEqual({
"status": "draft", "status": "draft",
...@@ -580,6 +584,7 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin): ...@@ -580,6 +584,7 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(200) self.assertResponseCode(200)
self.assertLastModifiedHeader() self.assertLastModifiedHeader()
self.assertCacheControlHeader()
self.assertResponseJson() self.assertResponseJson()
self.assertEqual({ self.assertEqual({
"status": "draft", "status": "draft",
...@@ -611,6 +616,7 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin): ...@@ -611,6 +616,7 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(200) self.assertResponseCode(200)
self.assertLastModifiedHeader() self.assertLastModifiedHeader()
self.assertCacheControlHeader()
self.assertResponseJson() self.assertResponseJson()
self.assertEqual({ self.assertEqual({
"status": "draft", "status": "draft",
...@@ -642,6 +648,7 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin): ...@@ -642,6 +648,7 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(200) self.assertResponseCode(200)
self.assertLastModifiedHeader() self.assertLastModifiedHeader()
self.assertCacheControlHeader()
self.assertResponseJson() self.assertResponseJson()
self.assertEqual({ self.assertEqual({
"status": "draft", "status": "draft",
......
41 42
\ 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