Skip to content

Commit

Permalink
Fix tests to work with the Zope security fix.
Browse files Browse the repository at this point in the history
Instead of an empty byte we get an empty text now.  I don't know what in the security fix causes this, but seems okay.
  • Loading branch information
mauritsvanrees committed Dec 21, 2022
1 parent 34be14f commit e6941fd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions news/106.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix tests to work with the Zope security fix.
[maurits]
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 @@ -199,7 +199,7 @@ def test_composite_viewsxx(self):
browser.open(self.portal["f1"]["d1"].absolute_url())
# This should be a 304 response
self.assertEqual("304 Not Modified", browser.headers["Status"])
self.assertEqual(b"", browser.contents)
self.assertEqual("", browser.contents)

# Request the anonymous folder
now = stable_now()
Expand Down Expand Up @@ -274,7 +274,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.assertEqual("", browser.contents)

# Edit the page to update the etag
testText2 = "Testing... body two"
Expand Down Expand Up @@ -369,7 +369,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.assertEqual("", browser.contents)

# Request the authenticated rss feed
now = stable_now()
Expand Down Expand Up @@ -504,7 +504,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.assertEqual("", browser.contents)

# Request an image scale
now = stable_now()
Expand Down Expand Up @@ -560,7 +560,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.assertEqual("", browser.contents)

# 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 @@ -177,7 +177,7 @@ def test_composite_views(self):
browser.open(self.portal["f1"]["d1"].absolute_url())
# This should be a 304 response
self.assertEqual("304 Not Modified", browser.headers["Status"])
self.assertEqual(b"", browser.contents)
self.assertEqual("", browser.contents)

# Request the anonymous folder
now = stable_now()
Expand Down Expand Up @@ -245,7 +245,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.assertEqual("", browser.contents)

# Edit the page to update the etag
testText2 = "Testing... body two"
Expand Down Expand Up @@ -334,7 +334,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.assertEqual("", browser.contents)

# Request the authenticated rss feed
now = stable_now()
Expand Down Expand Up @@ -421,7 +421,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.assertEqual("", browser.contents)

# Request an image scale
now = stable_now()
Expand Down Expand Up @@ -471,7 +471,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.assertEqual("", browser.contents)

# 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 e6941fd

Please sign in to comment.