diff options
| author | Pierre Dulac | 2013-03-03 01:09:39 +0100 |
|---|---|---|
| committer | Pierre Dulac | 2013-03-06 22:42:09 +0100 |
| commit | 8845c0be88bf68fa0e42d05c7196cd52d897623b (patch) | |
| tree | 820a7e5ad1f3de55e4862f091b421c67692a6de2 /rest_framework/tests/authentication.py | |
| parent | 30e3775b8b209242141357bad0a69b6cc503c6f9 (diff) | |
| download | django-rest-framework-8845c0be88bf68fa0e42d05c7196cd52d897623b.tar.bz2 | |
Fix import errors
Diffstat (limited to 'rest_framework/tests/authentication.py')
| -rw-r--r-- | rest_framework/tests/authentication.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/rest_framework/tests/authentication.py b/rest_framework/tests/authentication.py index 9d67a005..a02aef55 100644 --- a/rest_framework/tests/authentication.py +++ b/rest_framework/tests/authentication.py @@ -46,10 +46,14 @@ urlpatterns = patterns('', (r'^basic/$', MockView.as_view(authentication_classes=[BasicAuthentication])), (r'^token/$', MockView.as_view(authentication_classes=[TokenAuthentication])), (r'^auth-token/$', 'rest_framework.authtoken.views.obtain_auth_token'), - url(r'^oauth2/', include('provider.oauth2.urls', namespace = 'oauth2')), - url(r'^oauth2-test/$', MockView.as_view(authentication_classes=[OAuth2Authentication])), ) +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])), + ) + class BasicAuthTests(TestCase): """Basic authentication""" |
