mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-30 01:49:50 +03:00
Fix BytesWarning in test_schemas.py
When Python is run with the -b command line argument, the following warning was previously emitted: tests/test_schemas.py::test_schema_handles_exception .../django-rest-framework/tests/test_schemas.py:1361: BytesWarning: str() on a bytes instance assert "You do not have permission to perform this action." in str(response.content) To fix this warning decode the bytes with an explicit encoding. For details on the -b command line argument, see: https://docs.python.org/3/using/cmdline.html#cmdoption-b
This commit is contained in:
parent
e16273a658
commit
c231bb32d7
|
@ -1358,4 +1358,4 @@ def test_schema_handles_exception():
|
|||
response = schema_view(request)
|
||||
response.render()
|
||||
assert response.status_code == 403
|
||||
assert "You do not have permission to perform this action." in str(response.content)
|
||||
assert b"You do not have permission to perform this action." in response.content
|
||||
|
|
Loading…
Reference in New Issue
Block a user