From 7afb2edfdfa3a274d4f158d82f769904e5cbd624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 1 Aug 2023 13:35:24 +0200 Subject: [PATCH] Fix test compatibility with werkzeug 0.15.x Remove the check for `Content-Length` header that is not provided by default anymore with werkzeug 0.15.x. See: https://github.com/pallets/werkzeug/issues/2347 Taken from https://github.com/postmanlabs/httpbin/pull/684 --- setup.py | 2 +- tests/test_httpbin.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 8918bbf6..b83bee19 100644 --- a/setup.py +++ b/setup.py @@ -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' ], ) diff --git a/tests/test_httpbin.py b/tests/test_httpbin.py index 9bc90663..e5588bb2 100755 --- a/tests/test_httpbin.py +++ b/tests/test_httpbin.py @@ -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') @@ -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'))