From c36ff4e052f0a6a188100908b03d2c3328fd97bc Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 31 May 2013 11:17:33 +0100 Subject: [PATCH] Cleaning up imports and whitespace --- rest_framework/tests/models.py | 2 +- rest_framework/tests/test_authentication.py | 4 ++-- rest_framework/tests/test_routers.py | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/rest_framework/tests/models.py b/rest_framework/tests/models.py index abf50a2de..e2d4eacdc 100644 --- a/rest_framework/tests/models.py +++ b/rest_framework/tests/models.py @@ -162,8 +162,8 @@ class NullableOneToOneSource(RESTFrameworkModel): target = models.OneToOneField(OneToOneTarget, null=True, blank=True, related_name='nullable_source') + # Serializer used to test BasicModel class BasicModelSerializer(serializers.ModelSerializer): class Meta: model = BasicModel - diff --git a/rest_framework/tests/test_authentication.py b/rest_framework/tests/test_authentication.py index 90e1f5c40..05e9fbc30 100644 --- a/rest_framework/tests/test_authentication.py +++ b/rest_framework/tests/test_authentication.py @@ -48,7 +48,7 @@ urlpatterns = patterns('', (r'^token/$', MockView.as_view(authentication_classes=[TokenAuthentication])), (r'^auth-token/$', 'rest_framework.authtoken.views.obtain_auth_token'), (r'^oauth/$', MockView.as_view(authentication_classes=[OAuthAuthentication])), - (r'^oauth-with-scope/$', MockView.as_view(authentication_classes=[OAuthAuthentication], + (r'^oauth-with-scope/$', MockView.as_view(authentication_classes=[OAuthAuthentication], permission_classes=[permissions.TokenHasReadWriteScope])) ) @@ -56,7 +56,7 @@ if oauth2_provider is not None: urlpatterns += patterns('', url(r'^oauth2/', include('provider.oauth2.urls', namespace='oauth2')), url(r'^oauth2-test/$', MockView.as_view(authentication_classes=[OAuth2Authentication])), - url(r'^oauth2-with-scope-test/$', MockView.as_view(authentication_classes=[OAuth2Authentication], + url(r'^oauth2-with-scope-test/$', MockView.as_view(authentication_classes=[OAuth2Authentication], permission_classes=[permissions.TokenHasReadWriteScope])), ) diff --git a/rest_framework/tests/test_routers.py b/rest_framework/tests/test_routers.py index 4e4765cb2..c73f5e726 100644 --- a/rest_framework/tests/test_routers.py +++ b/rest_framework/tests/test_routers.py @@ -1,12 +1,10 @@ from __future__ import unicode_literals from django.test import TestCase from django.test.client import RequestFactory -from rest_framework import status from rest_framework.response import Response from rest_framework import viewsets from rest_framework.decorators import link, action from rest_framework.routers import SimpleRouter -import copy factory = RequestFactory() @@ -51,5 +49,3 @@ class TestSimpleRouter(TestCase): else: method_map = 'get' self.assertEqual(route.mapping[method_map], endpoint) - -