diff options
| author | Xavier Ordoquy | 2014-04-30 22:24:01 +0200 | 
|---|---|---|
| committer | Xavier Ordoquy | 2014-04-30 22:24:01 +0200 | 
| commit | 2aca69a94601858a462060bc55154c812f70fb91 (patch) | |
| tree | 86f4d926344bea677ff8dd56505332fc16fdecc8 /tests/test_authentication.py | |
| parent | c5f68fba0638a15fa3c802f1bafc664e890611dc (diff) | |
| parent | d8fb81ceb15afe09a50584afcc466de812d30046 (diff) | |
| download | django-rest-framework-2aca69a94601858a462060bc55154c812f70fb91.tar.bz2 | |
Merge remote-tracking branch 'reference/master' into feature/pytest
Conflicts:
	tests/test_serializer.py
Diffstat (limited to 'tests/test_authentication.py')
| -rw-r--r-- | tests/test_authentication.py | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/tests/test_authentication.py b/tests/test_authentication.py index 1d90493e..d0290eac 100644 --- a/tests/test_authentication.py +++ b/tests/test_authentication.py @@ -19,7 +19,7 @@ from rest_framework.authentication import (      OAuth2Authentication  )  from rest_framework.authtoken.models import Token -from rest_framework.compat import patterns, url, include +from rest_framework.compat import patterns, url, include, six  from rest_framework.compat import oauth2_provider, oauth2_provider_scope  from rest_framework.compat import oauth, oauth_provider  from rest_framework.test import APIRequestFactory, APIClient @@ -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, six.string_types)) +      def test_token_login_json(self):          """Ensure token login view using JSON POST works."""          client = APIClient(enforce_csrf_checks=True) | 
