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
84e22cc2
Commit
84e22cc2
authored
May 30, 2017
by
Bekhzod Tillakhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scheme fix when unauth and Flask8 lint fix
parent
9c9525b1
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
14 additions
and
2 deletions
+14
-2
rest_framework/templates/rest_framework/docs/document.html
+2
-1
rest_framework/templates/rest_framework/docs/sidebar.html
+2
-0
tests/test_atomic_requests.py
+1
-0
tests/test_fields.py
+0
-1
tests/test_permissions.py
+3
-0
tests/test_renderers.py
+1
-0
tests/test_request.py
+1
-0
tests/test_response.py
+1
-0
tests/test_reverse.py
+1
-0
tests/test_schemas.py
+1
-0
tests/test_validation.py
+1
-0
No files found.
rest_framework/templates/rest_framework/docs/document.html
View file @
84e22cc2
...
...
@@ -13,7 +13,7 @@
{% if 'javascript' in langs %}{% include "rest_framework/docs/langs/javascript-intro.html" %}{% endif %}
</div>
</div>
{% if document.data %}
{% for section_key, section in document.data|items %}
{% if section_key %}
<h2
id=
"{{ section_key }}"
class=
"coredocs-section-title"
>
{{ section_key }}
<a
href=
"#{{ section_key }}"
><i
class=
"fa fa-link"
aria-hidden=
"true"
></i>
...
...
@@ -28,3 +28,4 @@
{% for link_key, link in document.links|items %}
{% include "rest_framework/docs/link.html" %}
{% endfor %}
{% endif %}
rest_framework/templates/rest_framework/docs/sidebar.html
View file @
84e22cc2
...
...
@@ -5,6 +5,7 @@
<i
class=
"fa fa-bars fa-2x toggle-btn"
data-toggle=
"collapse"
data-target=
"#menu-content"
></i>
<div
class=
"menu-list"
>
<ul
id=
"menu-content"
class=
"menu-content collapse out"
>
{% if document.data %}
{% for section_key, section in document.data|items %}
<li
data-toggle=
"collapse"
data-target=
"#{{ section_key }}-dropdown"
class=
"collapsed"
>
<a><i
class=
"fa fa-dot-circle-o fa-lg"
></i>
{% if section_key %}{{ section_key }}{% else %}API Endpoints{% endif %}
<span
class=
"arrow"
></span></a>
...
...
@@ -15,6 +16,7 @@
{% endfor %}
</ul>
{% endfor %}
{% endif %}
</ul>
<ul
class=
"menu-list menu-list-bottom"
>
...
...
tests/test_atomic_requests.py
View file @
84e22cc2
...
...
@@ -45,6 +45,7 @@ class NonAtomicAPIExceptionView(APIView):
BasicModel
.
objects
.
all
()
raise
Http404
urlpatterns
=
(
url
(
r'^$'
,
NonAtomicAPIExceptionView
.
as_view
()),
)
...
...
tests/test_fields.py
View file @
84e22cc2
...
...
@@ -1132,7 +1132,6 @@ class TestDateTimeField(FieldValues):
valid_inputs
=
{
'2001-01-01 13:00'
:
datetime
.
datetime
(
2001
,
1
,
1
,
13
,
00
,
tzinfo
=
utc
),
'2001-01-01T13:00'
:
datetime
.
datetime
(
2001
,
1
,
1
,
13
,
00
,
tzinfo
=
utc
),
'2001-01-01T13:00Z'
:
datetime
.
datetime
(
2001
,
1
,
1
,
13
,
00
,
tzinfo
=
utc
),
datetime
.
datetime
(
2001
,
1
,
1
,
13
,
00
):
datetime
.
datetime
(
2001
,
1
,
1
,
13
,
00
,
tzinfo
=
utc
),
datetime
.
datetime
(
2001
,
1
,
1
,
13
,
00
,
tzinfo
=
utc
):
datetime
.
datetime
(
2001
,
1
,
1
,
13
,
00
,
tzinfo
=
utc
),
# Django 1.4 does not support timezone string parsing.
...
...
tests/test_permissions.py
View file @
84e22cc2
...
...
@@ -246,6 +246,7 @@ class ObjectPermissionInstanceView(generics.RetrieveUpdateDestroyAPIView):
authentication_classes
=
[
authentication
.
BasicAuthentication
]
permission_classes
=
[
ViewObjectPermissions
]
object_permissions_view
=
ObjectPermissionInstanceView
.
as_view
()
...
...
@@ -255,6 +256,7 @@ class ObjectPermissionListView(generics.ListAPIView):
authentication_classes
=
[
authentication
.
BasicAuthentication
]
permission_classes
=
[
ViewObjectPermissions
]
object_permissions_list_view
=
ObjectPermissionListView
.
as_view
()
...
...
@@ -443,6 +445,7 @@ class DeniedObjectView(PermissionInstanceView):
class
DeniedObjectViewWithDetail
(
PermissionInstanceView
):
permission_classes
=
(
BasicObjectPermWithDetail
,)
denied_view
=
DeniedView
.
as_view
()
denied_view_with_detail
=
DeniedViewWithDetail
.
as_view
()
...
...
tests/test_renderers.py
View file @
84e22cc2
...
...
@@ -108,6 +108,7 @@ class HTMLView1(APIView):
def
get
(
self
,
request
,
**
kwargs
):
return
Response
(
'text'
)
urlpatterns
=
[
url
(
r'^.*\.(?P<format>.+)$'
,
MockView
.
as_view
(
renderer_classes
=
[
RendererA
,
RendererB
])),
url
(
r'^$'
,
MockView
.
as_view
(
renderer_classes
=
[
RendererA
,
RendererB
])),
...
...
tests/test_request.py
View file @
84e22cc2
...
...
@@ -120,6 +120,7 @@ class MockView(APIView):
return
Response
(
status
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
urlpatterns
=
[
url
(
r'^$'
,
MockView
.
as_view
()),
]
...
...
tests/test_response.py
View file @
84e22cc2
...
...
@@ -32,6 +32,7 @@ class MockJsonRenderer(BaseRenderer):
class
MockTextMediaRenderer
(
BaseRenderer
):
media_type
=
'text/html'
DUMMYSTATUS
=
status
.
HTTP_200_OK
DUMMYCONTENT
=
'dummycontent'
...
...
tests/test_reverse.py
View file @
84e22cc2
...
...
@@ -13,6 +13,7 @@ factory = APIRequestFactory()
def
null_view
(
request
):
pass
urlpatterns
=
[
url
(
r'^view$'
,
null_view
,
name
=
'view'
),
]
...
...
tests/test_schemas.py
View file @
84e22cc2
...
...
@@ -70,6 +70,7 @@ class ExampleViewSet(ModelViewSet):
assert
self
.
action
return
super
(
ExampleViewSet
,
self
)
.
get_serializer
(
*
args
,
**
kwargs
)
if
coreapi
:
schema_view
=
get_schema_view
(
title
=
'Example API'
)
else
:
...
...
tests/test_validation.py
View file @
84e22cc2
...
...
@@ -243,6 +243,7 @@ class RegexSerializer(serializers.Serializer):
validators
=
[
RegexValidator
(
regex
=
re
.
compile
(
'^[0-9]{4,6}$'
),
message
=
'A PIN is 4-6 digits'
)])
expected_repr
=
"""
RegexSerializer():
pin = CharField(validators=[<django.core.validators.RegexValidator object>])
...
...
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