Commit dc2a5acd authored by Vincent Bechu's avatar Vincent Bechu

[officejs_test] fix tests

Remove charset format for content type
Add hash when necessary

/reviewed-on nexedi/officejs-appstore!1
parent 1c3fad1b
......@@ -129,9 +129,9 @@ class TestOfficeJSScenario(SecurityTestCase):
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
)
self.assertEquals(
response.getheader('Content-Type'),
'text/html; charset=utf-8'
self.assertTrue(
'text/html;' in response.getheader('Content-Type'),
response.getheader('Content-Type')
)
self.assertEquals(
response.getheader('Content-Security-Policy'),
......@@ -142,7 +142,7 @@ class TestOfficeJSScenario(SecurityTestCase):
'SAMEORIGIN'
)
self.assertEquals(
response.getheader('Vary'),
response.getheader('Vary').replace(' ', ''),
'Accept-Language,Cookie,Authorization,Accept-Encoding'
)
......@@ -157,14 +157,14 @@ class TestOfficeJSScenario(SecurityTestCase):
page_content = response.read()
self.assertEquals("""CACHE MANIFEST
# development""",
# development + hash""",
page_content
)
self.assertEquals(response.status, 200)
self.assertEquals(
response.getheader('Content-Type'),
'text/cache-manifest; charset=utf-8'
self.assertTrue(
'text/cache-manifest;' in response.getheader('Content-Type'),
response.getheader('Content-Type')
)
self.assertEquals(
response.getheader('Cache-Control'),
......@@ -189,9 +189,9 @@ class TestOfficeJSScenario(SecurityTestCase):
response.getheader('Cache-Control'),
'max-age=31536000, stale-while-revalidate=31536000, stale-if-error=31536000, public'
)
self.assertEquals(
response.getheader('Content-Type'),
'text/html; charset=utf-8'
self.assertTrue(
'text/html;' in response.getheader('Content-Type'),
response.getheader('Content-Type')
)
self.assertEquals(
response.getheader('Content-Security-Policy'),
......@@ -243,9 +243,9 @@ class TestOfficeJSScenario(SecurityTestCase):
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
)
self.assertEquals(
response.getheader('Content-Type'),
'text/html; charset=utf-8'
self.assertTrue(
'text/html;' in response.getheader('Content-Type'),
response.getheader('Content-Type')
)
self.assertEquals(
response.getheader('Content-Security-Policy'),
......@@ -256,7 +256,7 @@ class TestOfficeJSScenario(SecurityTestCase):
'SAMEORIGIN'
)
self.assertEquals(
response.getheader('Vary'),
response.getheader('Vary').replace(' ', ''),
'Accept-Language,Cookie,Authorization,Accept-Encoding'
)
......@@ -279,7 +279,7 @@ class TestOfficeJSScenario(SecurityTestCase):
page_content = response.read()
self.assertTrue(
'document.location.replace("%s/")' % web_section.getId() in page_content,
'document.location.replace("%s/" + document.location.hash)' % web_section.getId() in page_content,
page_content
)
self.assertTrue(
......@@ -291,9 +291,9 @@ class TestOfficeJSScenario(SecurityTestCase):
response.getheader('Cache-Control'),
'max-age=0, public, must-revalidate'
)
self.assertEquals(
response.getheader('Content-Type'),
'text/html; charset=utf-8'
self.assertTrue(
'text/html;' in response.getheader('Content-Type'),
response.getheader('Content-Type')
)
self.assertEquals(
response.getheader('Content-Security-Policy'),
......@@ -304,7 +304,7 @@ class TestOfficeJSScenario(SecurityTestCase):
'SAMEORIGIN'
)
self.assertEquals(
response.getheader('Vary'),
response.getheader('Vary').replace(' ', ''),
'Accept-Language,Cookie,Authorization,Accept-Encoding'
)
......@@ -318,14 +318,14 @@ class TestOfficeJSScenario(SecurityTestCase):
page_content = response.read()
self.assertEquals("""CACHE MANIFEST
# %s""" % web_section.getId(),
# %s + hash""" % web_section.getId(),
page_content
)
self.assertEquals(response.status, 200)
self.assertEquals(
response.getheader('Content-Type'),
'text/cache-manifest; charset=utf-8'
self.assertTrue(
'text/cache-manifest;' in response.getheader('Content-Type'),
response.getheader('Content-Type')
)
self.assertEquals(
response.getheader('Cache-Control'),
......
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