changeset 635579072787 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=635579072787
description:
Add compatibility with Werkzeug 2.1.0
issue11353
review356241003
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 87650e5c757e -r 635579072787 trytond/tests/test_routes.py
--- a/trytond/tests/test_routes.py Wed Mar 30 19:20:31 2022 +0200
+++ 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 DB_NAME, activate_module, 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 87650e5c757e -r 635579072787 trytond/tests/test_wsgi.py
--- a/trytond/tests/test_wsgi.py Wed Mar 30 19:20:31 2022 +0200
+++ b/trytond/tests/test_wsgi.py Thu Mar 31 13:43:36 2022 +0200
@@ -35,7 +35,7 @@
raise exception
client = Client(app)
- (response, status, headers) = client.get('/willfail')
+ _ = client.get('/willfail')
spy.assert_called_once_with(app, sentinel.request, exception)
@@ -61,7 +61,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)
@@ -85,7 +85,7 @@
raise exception
client = Client(app)
- (response, status, headers) = client.get('/willfail')
+ _ = client.get('/willfail')
spy.assert_called_once_with(app, sentinel.request, exception)
@@ -106,10 +106,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():