Skip to content

Commit

Permalink
Fixed header tests on Python 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Jan 9, 2023
1 parent 9accdb1 commit e357e9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions plone/app/caching/tests/test_profile_with_caching_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def test_composite_viewsxx(self):
# get a possibly wrong Content-Type in a 304 status.
# See https://github.com/zopefoundation/Zope/issues/1089.
self.assertEqual(b'', browser.contents)
self.assertFalse(browser.headers['Content-Type'])
self.assertFalse(browser.headers.get('Content-Type'))

# Request the anonymous folder
now = stable_now()
Expand Down Expand Up @@ -266,7 +266,7 @@ def test_composite_viewsxx(self):
# This should be a 304 response
self.assertEqual('304 Not Modified', browser.headers['Status'])
self.assertEqual(b'', browser.contents)
self.assertFalse(browser.headers['Content-Type'])
self.assertFalse(browser.headers.get('Content-Type'))

# Edit the page to update the etag
testText2 = 'Testing... body two'
Expand Down Expand Up @@ -360,7 +360,7 @@ def test_content_feeds(self):
# This should be a 304 response
self.assertEqual('304 Not Modified', browser.headers['Status'])
self.assertEqual(b'', browser.contents)
self.assertFalse(browser.headers['Content-Type'])
self.assertFalse(browser.headers.get('Content-Type'))

# Request the authenticated rss feed
now = stable_now()
Expand Down Expand Up @@ -491,7 +491,7 @@ def test_content_files(self):
# This should be a 304 response
self.assertEqual('304 Not Modified', browser.headers['Status'])
self.assertEqual(b'', browser.contents)
self.assertFalse(browser.headers['Content-Type'])
self.assertFalse(browser.headers.get('Content-Type'))

# Request an image scale
now = stable_now()
Expand Down Expand Up @@ -543,7 +543,7 @@ def test_resources(self):
# This should be a 304 response
self.assertEqual('304 Not Modified', browser.headers['Status'])
self.assertEqual(b'', browser.contents)
self.assertFalse(browser.headers['Content-Type'])
self.assertFalse(browser.headers.get('Content-Type'))

# Request a large datafile (over 64K) to test files that use
# the "response.write()" function to initiate a streamed response.
Expand Down
10 changes: 5 additions & 5 deletions plone/app/caching/tests/test_profile_without_caching_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def test_composite_views(self):
# get a possibly wrong Content-Type in a 304 status.
# See https://github.com/zopefoundation/Zope/issues/1089.
self.assertEqual(b'', browser.contents)
self.assertFalse(browser.headers['Content-Type'])
self.assertFalse(browser.headers.get('Content-Type'))

# Request the anonymous folder
now = stable_now()
Expand Down Expand Up @@ -260,7 +260,7 @@ def test_composite_views(self):
# This should be a 304 response
self.assertEqual('304 Not Modified', browser.headers['Status'])
self.assertEqual(b'', browser.contents)
self.assertFalse(browser.headers['Content-Type'])
self.assertFalse(browser.headers.get('Content-Type'))

# Edit the page to update the etag
testText2 = 'Testing... body two'
Expand Down Expand Up @@ -347,7 +347,7 @@ def test_content_feeds(self):
# This should be a 304 response
self.assertEqual('304 Not Modified', browser.headers['Status'])
self.assertEqual(b'', browser.contents)
self.assertFalse(browser.headers['Content-Type'])
self.assertFalse(browser.headers.get('Content-Type'))

# Request the authenticated rss feed
now = stable_now()
Expand Down Expand Up @@ -434,7 +434,7 @@ def test_content_files(self):
# This should be a 304 response
self.assertEqual('304 Not Modified', browser.headers['Status'])
self.assertEqual(b'', browser.contents)
self.assertFalse(browser.headers['Content-Type'])
self.assertFalse(browser.headers.get('Content-Type'))

# Request an image scale
now = stable_now()
Expand Down Expand Up @@ -484,7 +484,7 @@ def test_resources(self):
# This should be a 304 response
self.assertEqual('304 Not Modified', browser.headers['Status'])
self.assertEqual(b'', browser.contents)
self.assertFalse(browser.headers['Content-Type'])
self.assertFalse(browser.headers.get('Content-Type'))

# Request a large datafile (over 64K) to test files that use
# the "response.write()" function to initiate a streamed response.
Expand Down

0 comments on commit e357e9b

Please sign in to comment.