changeset 34ec02f528d7 in trytond:6.2 details: https://hg.tryton.org/trytond?cmd=changeset&node=34ec02f528d7 description: Add compatibility with Werkzeug 2.1.0
issue11353 review356241003 (grafted from 6355790727873d028d833d6126a934e593114a67) diffstat: trytond/tests/test_routes.py | 24 ++++++++++++------------ trytond/tests/test_wsgi.py | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diffs (155 lines): diff -r 67a94f7e03e8 -r 34ec02f528d7 trytond/tests/test_routes.py --- a/trytond/tests/test_routes.py Sat Mar 19 15:04:09 2022 +0100 +++ b/trytond/tests/test_routes.py Thu Mar 31 13:43:36 2022 +0200 @@ -6,7 +6,7 @@ import unittest from werkzeug.test import Client -from werkzeug.wrappers import BaseResponse +from werkzeug.wrappers import Response from trytond.pool import Pool from trytond.tests.test_tryton import activate_module, DB_NAME, drop_db @@ -46,7 +46,7 @@ def test_data_no_field(self): "Test GET data without field" - c = Client(app, BaseResponse) + c = Client(app, Response) response = c.get(self.data_url('res.user'), headers=self.auth_headers) @@ -55,7 +55,7 @@ def test_data_one_field(self): "Test GET data with one field" - c = Client(app, BaseResponse) + c = Client(app, Response) response = c.get( self.data_url('res.user'), headers=self.auth_headers, @@ -66,7 +66,7 @@ def test_data_multiple_fields(self): "Test GET data with multiple fields" - c = Client(app, BaseResponse) + c = Client(app, Response) response = c.get( self.data_url('res.user'), headers=self.auth_headers, @@ -78,7 +78,7 @@ def test_data_language(self): "Test GET data with language" - c = Client(app, BaseResponse) + c = Client(app, Response) response = c.get( self.data_url('ir.lang'), headers=self.auth_headers, @@ -93,7 +93,7 @@ def test_data_size(self): "Test GET data with size limit" - c = Client(app, BaseResponse) + c = Client(app, Response) response = c.get( self.data_url('ir.lang'), headers=self.auth_headers, @@ -107,7 +107,7 @@ def test_data_page(self): "Test GET data with page" - c = Client(app, BaseResponse) + c = Client(app, Response) response0 = c.get( self.data_url('ir.lang'), headers=self.auth_headers, @@ -130,7 +130,7 @@ def test_data_encoding(self): "Test GET data with encoding" - c = Client(app, BaseResponse) + c = Client(app, Response) response = c.get( self.data_url('ir.lang'), headers=self.auth_headers, @@ -147,7 +147,7 @@ def test_data_delimiter(self): "Test GET data with delimiter" - c = Client(app, BaseResponse) + c = Client(app, Response) response = c.get( self.data_url('res.user'), headers=self.auth_headers, @@ -159,7 +159,7 @@ def test_data_quotechar(self): "Test GET data with quotechar" - c = Client(app, BaseResponse) + c = Client(app, Response) response = c.get( self.data_url('res.user'), headers=self.auth_headers, @@ -172,7 +172,7 @@ def test_data_no_header(self): "Test GET data without header" - c = Client(app, BaseResponse) + c = Client(app, Response) response = c.get( self.data_url('res.user'), headers=self.auth_headers, @@ -183,7 +183,7 @@ def test_data_locale_format(self): "Test GET data in locale format" - c = Client(app, BaseResponse) + c = Client(app, Response) response_std = c.get( self.data_url('res.user'), headers=self.auth_headers, diff -r 67a94f7e03e8 -r 34ec02f528d7 trytond/tests/test_wsgi.py --- a/trytond/tests/test_wsgi.py Sat Mar 19 15:04:09 2022 +0100 +++ b/trytond/tests/test_wsgi.py Thu Mar 31 13:43:36 2022 +0200 @@ -34,7 +34,7 @@ raise exception client = Client(app) - (response, status, headers) = client.get('/willfail') + _ = client.get('/willfail') spy.assert_called_once_with(app, sentinel.request, exception) @@ -60,7 +60,7 @@ raise exception client = Client(app) - (response, status, headers) = client.get('/willfail') + _ = client.get('/willfail') spy1.assert_called_once_with(app, sentinel.request, exception) spy2.assert_called_once_with(app, sentinel.request, exception) @@ -84,7 +84,7 @@ raise exception client = Client(app) - (response, status, headers) = client.get('/willfail') + _ = client.get('/willfail') spy.assert_called_once_with(app, sentinel.request, exception) @@ -105,10 +105,10 @@ raise self.TestException('foo') client = Client(app) - (response, status, headers) = client.get('/willfail') + response = client.get('/willfail') - self.assertEqual(next(response), b'baz') - self.assertEqual(status, "418 I'M A TEAPOT") + self.assertEqual(next(response.response), b'baz') + self.assertEqual(response.status, "418 I'M A TEAPOT") def suite():