aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests
diff options
context:
space:
mode:
authorMax Peterson2014-04-28 12:35:55 +0100
committerMax Peterson2014-04-28 12:35:55 +0100
commit1c777ffe8b67c342bc1b27fefe67d1094a2f6b07 (patch)
treef2a84ac17d4a8c442e079f7104a23f14402d576c /rest_framework/tests
parent4a1ef6d4b15c504881662a2667564394cb333b6b (diff)
downloaddjango-rest-framework-1c777ffe8b67c342bc1b27fefe67d1094a2f6b07.tar.bz2
Ensure Token.generate_key returns a string.
Diffstat (limited to 'rest_framework/tests')
-rw-r--r--rest_framework/tests/test_authentication.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/rest_framework/tests/test_authentication.py b/rest_framework/tests/test_authentication.py
index c37d2a51..8773f580 100644
--- a/rest_framework/tests/test_authentication.py
+++ b/rest_framework/tests/test_authentication.py
@@ -195,6 +195,12 @@ class TokenAuthTests(TestCase):
token = Token.objects.create(user=self.user)
self.assertTrue(bool(token.key))
+ def test_generate_key_returns_string(self):
+ """Ensure generate_key returns a string"""
+ token = Token()
+ key = token.generate_key()
+ self.assertTrue(isinstance(key, str))
+
def test_token_login_json(self):
"""Ensure token login view using JSON POST works."""
client = APIClient(enforce_csrf_checks=True)