Skip to content

Commit

Permalink
Merge pull request #554 from fizyk/nomorecompat
Browse files Browse the repository at this point in the history
Removed missed compat import from tests
  • Loading branch information
leplatrem committed Apr 6, 2021
2 parents 2554896 + 86eb1a2 commit dbcf634
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import warnings
from unittest import mock

from pyramid import compat
from pyramid.request import Request
from webtest import TestApp
try:
Expand Down Expand Up @@ -609,11 +608,11 @@ class TestExtractedJSONValueTypes(unittest.TestCase):
"""
def test_extracted_json_values(self):
"""Extracted JSON values are unicode in PY2."""
body = '{"foo": "bar", "currency": "\xe2\x82\xac"}'
request = Request.blank('/', body=compat.bytes_(body))
body = b'{"foo": "bar", "currency": "\xe2\x82\xac"}'
request = Request.blank('/', body=body)
data = extract_cstruct(request)
self.assertEqual(type(data['body']['foo']), compat.text_type)
self.assertEqual(type(data['body']['currency']), compat.text_type)
self.assertEqual(type(data['body']['foo']), str)
self.assertEqual(type(data['body']['currency']), str)
self.assertEqual(data['body']['currency'], u'€')


Expand Down

0 comments on commit dbcf634

Please sign in to comment.