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

Check that Last-Modified is transmitted and its correct.

parent 931eede7
...@@ -8,6 +8,7 @@ import urlparse ...@@ -8,6 +8,7 @@ import urlparse
import json import json
import tempfile import tempfile
import os import os
from App.Common import rfc1123_date
class Simulator: class Simulator:
def __init__(self, outfile, method): def __init__(self, outfile, method):
...@@ -463,6 +464,10 @@ class VifibSlaposRestAPIV1InstanceMixin(VifibSlaposRestAPIV1Mixin): ...@@ -463,6 +464,10 @@ class VifibSlaposRestAPIV1InstanceMixin(VifibSlaposRestAPIV1Mixin):
transaction.commit() transaction.commit()
class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin): class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin):
def assertLastModifiedHeader(self):
calculated = rfc1123_date(self.software_instance.getModificationDate())
self.assertEqual(calculated, self.response.getheader('Last-Modified'))
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:
...@@ -510,6 +515,7 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin): ...@@ -510,6 +515,7 @@ class TestInstanceGET(VifibSlaposRestAPIV1InstanceMixin):
self.prepareResponse() self.prepareResponse()
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(200) self.assertResponseCode(200)
self.assertLastModifiedHeader()
self.assertResponseJson() self.assertResponseJson()
self.assertEqual({ self.assertEqual({
"status": "draft", "status": "draft",
......
39 40
\ 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