mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Python < 3 compatibility.
This commit is contained in:
parent
1c777ffe8b
commit
170fa10ae0
|
@ -199,7 +199,13 @@ class TokenAuthTests(TestCase):
|
|||
"""Ensure generate_key returns a string"""
|
||||
token = Token()
|
||||
key = token.generate_key()
|
||||
self.assertTrue(isinstance(key, str))
|
||||
try:
|
||||
# added in Python < 3
|
||||
base = unicode
|
||||
except NameError:
|
||||
# added in Python >= 3
|
||||
base = str
|
||||
self.assertTrue(isinstance(key, base))
|
||||
|
||||
def test_token_login_json(self):
|
||||
"""Ensure token login view using JSON POST works."""
|
||||
|
|
Loading…
Reference in New Issue
Block a user