Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
bfd72193
Commit
bfd72193
authored
Jun 11, 2015
by
Xavier Ordoquy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define the `urlpatterns` as a list of `url()....
parent
9f1805f2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
tests/browsable_api/auth_urls.py
+1
-1
tests/browsable_api/no_auth_urls.py
+2
-1
tests/test_authentication.py
+5
-5
tests/test_request.py
+2
-1
No files found.
tests/browsable_api/auth_urls.py
View file @
bfd72193
...
...
@@ -5,6 +5,6 @@ from .views import MockView
urlpatterns
=
[
(
r'^$'
,
MockView
.
as_view
()),
url
(
r'^$'
,
MockView
.
as_view
()),
url
(
r'^auth/'
,
include
(
'rest_framework.urls'
,
namespace
=
'rest_framework'
)),
]
tests/browsable_api/no_auth_urls.py
View file @
bfd72193
from
__future__
import
unicode_literals
from
django.conf.urls
import
url
from
.views
import
MockView
urlpatterns
=
[
(
r'^$'
,
MockView
.
as_view
()),
url
(
r'^$'
,
MockView
.
as_view
()),
]
tests/test_authentication.py
View file @
bfd72193
...
...
@@ -38,11 +38,11 @@ class MockView(APIView):
urlpatterns
=
[
(
r'^session/$'
,
MockView
.
as_view
(
authentication_classes
=
[
SessionAuthentication
])),
(
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'^auth/'
,
include
(
'rest_framework.urls'
,
namespace
=
'rest_framework'
))
url
(
r'^session/$'
,
MockView
.
as_view
(
authentication_classes
=
[
SessionAuthentication
])),
url
(
r'^basic/$'
,
MockView
.
as_view
(
authentication_classes
=
[
BasicAuthentication
])),
url
(
r'^token/$'
,
MockView
.
as_view
(
authentication_classes
=
[
TokenAuthentication
])),
url
(
r'^auth-token/$'
,
'rest_framework.authtoken.views.obtain_auth_token'
),
url
(
r'^auth/'
,
include
(
'rest_framework.urls'
,
namespace
=
'rest_framework'
))
,
]
...
...
tests/test_request.py
View file @
bfd72193
...
...
@@ -2,6 +2,7 @@
Tests for content parsing, and form-overloaded content parsing.
"""
from
__future__
import
unicode_literals
from
django.conf.urls
import
url
from
django.contrib.auth.models
import
User
from
django.contrib.auth
import
authenticate
,
login
,
logout
from
django.contrib.sessions.middleware
import
SessionMiddleware
...
...
@@ -189,7 +190,7 @@ class MockView(APIView):
return
Response
(
status
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
urlpatterns
=
[
(
r'^$'
,
MockView
.
as_view
()),
url
(
r'^$'
,
MockView
.
as_view
()),
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment