aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/test_authentication.py
diff options
context:
space:
mode:
authorEric Buehl2014-03-06 20:19:21 +0000
committerEric Buehl2014-03-06 20:21:44 +0000
commit34887ed75625a58d00c986b3ea5526877f4724b2 (patch)
tree9550083d51dce99acf2e744e85d891dd803d645c /rest_framework/tests/test_authentication.py
parent86375f2d9506bcd3c95cb9901d2237672a47da3f (diff)
downloaddjango-rest-framework-34887ed75625a58d00c986b3ea5526877f4724b2.tar.bz2
it's safe to import scope and constants
Diffstat (limited to 'rest_framework/tests/test_authentication.py')
-rw-r--r--rest_framework/tests/test_authentication.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/rest_framework/tests/test_authentication.py b/rest_framework/tests/test_authentication.py
index 90383eef..8caeb081 100644
--- a/rest_framework/tests/test_authentication.py
+++ b/rest_framework/tests/test_authentication.py
@@ -19,7 +19,7 @@ from rest_framework.authentication import (
)
from rest_framework.authtoken.models import Token
from rest_framework.compat import patterns, url, include
-from rest_framework.compat import oauth2_provider
+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
from rest_framework.views import APIView
@@ -581,7 +581,7 @@ class OAuth2Tests(TestCase):
def test_post_form_with_invalid_scope_failing_auth(self):
"""Ensure POSTing with a readonly scope instead of a write scope fails"""
read_only_access_token = self.access_token
- read_only_access_token.scope = oauth2_provider.scope.SCOPE_NAME_DICT['read']
+ read_only_access_token.scope = oauth2_provider_scope.SCOPE_NAME_DICT['read']
read_only_access_token.save()
auth = self._create_authorization_header(token=read_only_access_token.token)
response = self.csrf_client.get('/oauth2-with-scope-test/', HTTP_AUTHORIZATION=auth)
@@ -593,7 +593,7 @@ class OAuth2Tests(TestCase):
def test_post_form_with_valid_scope_passing_auth(self):
"""Ensure POSTing with a write scope succeed"""
read_write_access_token = self.access_token
- read_write_access_token.scope = oauth2_provider.scope.SCOPE_NAME_DICT['write']
+ read_write_access_token.scope = oauth2_provider_scope.SCOPE_NAME_DICT['write']
read_write_access_token.save()
auth = self._create_authorization_header(token=read_write_access_token.token)
response = self.csrf_client.post('/oauth2-with-scope-test/', HTTP_AUTHORIZATION=auth)