Fix some tests caused by unicode rendering.

This commit is contained in:
Itamar Turner-Trauring 2020-12-23 09:34:48 -05:00
parent c5b403bd2f
commit f736dc6f7b
2 changed files with 6 additions and 3 deletions

View File

@ -746,7 +746,10 @@ class MultiFormatResourceTests(TrialTestCase):
"<title>400 - Bad Format</title>", response_body,
)
self.assertIn(
"Unknown t value: 'foo'", response_body,
"Unknown t value:", response_body,
)
self.assertIn(
"'foo'", response_body,
)

View File

@ -1,5 +1,5 @@
from past.builtins import unicode
from six import ensure_text
from six import ensure_text, ensure_str
import time
import json
@ -112,7 +112,7 @@ def parse_replace_arg(replace):
try:
return boolean_of_arg(replace)
except WebError:
raise WebError("invalid replace= argument: %r" % (replace,), http.BAD_REQUEST)
raise WebError("invalid replace= argument: %r" % (ensure_str(replace),), http.BAD_REQUEST)
def get_format(req, default="CHK"):