Skip to content

Commit

Permalink
test that the HEAD Content-Length is correct, not its exact value
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Sep 14, 2013
1 parent 846690c commit 456b497
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plone/namedfile/tests/test_scaling.py
Expand Up @@ -282,12 +282,14 @@ def testHeadRequestMethod(self):
scale = self.view.scale('image', width=64, height=64)
# make sure the referenced image scale is available
url = scale.url.replace('http://nohost', '')
get_response = self.publish(url, basic=self.getCredentials())
response = self.publish(url,
basic=self.getCredentials(),
request_method='HEAD')
self.assertEqual(response.getStatus(), 200)
self.assertEqual(response.getHeader('Content-Type'), 'image/jpeg')
self.assertEqual(response.getHeader('Content-Length'), '312')
self.assertEqual(
response.getHeader('Content-Length'), str(len(get_response.getBody())))
self.assertEqual(response.getBody(), '')

def testPublishThumbViaUID(self):
Expand Down

1 comment on commit 456b497

@mister-roboto
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing information:

Please sign in to comment.