Skip to content

Commit

Permalink
Fix test compatibility with werkzeug 0.15.x
Browse files Browse the repository at this point in the history
Remove the check for `Content-Length` header that is not provided
by default anymore with werkzeug 0.15.x.

See: pallets/werkzeug#2347

Taken from postmanlabs#684
  • Loading branch information
mgorny committed Aug 1, 2023
1 parent f67bf70 commit 7afb2ed
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
include_package_data = True, # include files listed in MANIFEST.in
install_requires=[
'Flask<1.1', 'MarkupSafe<2.1', 'decorator', 'itsdangerous<2.1', 'brotlipy',
'raven[flask]', 'werkzeug<0.15', 'gevent', 'flasgger', 'jinja2<3.1'
'raven[flask]', 'werkzeug<2', 'gevent', 'flasgger', 'jinja2<3.1'
],
)
2 changes: 0 additions & 2 deletions tests/test_httpbin.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def test_get(self):
data = json.loads(response.data.decode('utf-8'))
self.assertEqual(data['args'], {})
self.assertEqual(data['headers']['Host'], 'localhost')
self.assertEqual(data['headers']['Content-Length'], '0')
self.assertEqual(data['headers']['User-Agent'], 'test')
# self.assertEqual(data['origin'], None)
self.assertEqual(data['url'], 'http://localhost/get')
Expand All @@ -161,7 +160,6 @@ def test_anything(self):
data = json.loads(response.data.decode('utf-8'))
self.assertEqual(data['args'], {})
self.assertEqual(data['headers']['Host'], 'localhost')
self.assertEqual(data['headers']['Content-Length'], '0')
self.assertEqual(data['url'], 'http://localhost/anything/foo/bar')
self.assertEqual(data['method'], 'GET')
self.assertTrue(response.data.endswith(b'\n'))
Expand Down

0 comments on commit 7afb2ed

Please sign in to comment.