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
a42afa04
Commit
a42afa04
authored
May 18, 2013
by
Nikolaus Schlemm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draft for fields' metadata via OPTIONS - needs review and decision
parent
b4dbfa98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
2 deletions
+40
-2
rest_framework/tests/generics.py
+40
-2
No files found.
rest_framework/tests/generics.py
View file @
a42afa04
...
@@ -121,8 +121,27 @@ class TestRootView(TestCase):
...
@@ -121,8 +121,27 @@ class TestRootView(TestCase):
'text/html'
'text/html'
],
],
'name'
:
'Root'
,
'name'
:
'Root'
,
'description'
:
'Example description for OPTIONS.'
'description'
:
'Example description for OPTIONS.'
,
'actions'
:
{}
}
}
# TODO: this is just a draft for fields' metadata - needs review and decision
for
method
in
(
'HEAD'
,
'GET'
,
'POST'
,
'OPTIONS'
):
expected
[
'actions'
][
method
]
=
{
'text'
:
{
'description'
:
''
,
'label'
:
''
,
'readonly'
:
False
,
'required'
:
True
,
'type'
:
'CharField'
,
},
'id'
:
{
'description'
:
''
,
'label'
:
''
,
'readonly'
:
True
,
'required'
:
True
,
'type'
:
'IntegerField'
,
},
}
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
self
.
assertEqual
(
response
.
data
,
expected
)
self
.
assertEqual
(
response
.
data
,
expected
)
...
@@ -238,8 +257,27 @@ class TestInstanceView(TestCase):
...
@@ -238,8 +257,27 @@ class TestInstanceView(TestCase):
'text/html'
'text/html'
],
],
'name'
:
'Instance'
,
'name'
:
'Instance'
,
'description'
:
'Example description for OPTIONS.'
'description'
:
'Example description for OPTIONS.'
,
'actions'
:
{}
}
}
# TODO: this is just a draft idea for fields' metadata - needs review and decision
for
method
in
(
'HEAD'
,
'GET'
,
'PATCH'
,
'PUT'
,
'OPTIONS'
,
'DELETE'
):
expected
[
'actions'
][
method
]
=
{
'text'
:
{
'description'
:
''
,
'label'
:
''
,
'readonly'
:
False
,
'required'
:
True
,
'type'
:
'CharField'
,
},
'id'
:
{
'description'
:
''
,
'label'
:
''
,
'readonly'
:
True
,
'required'
:
True
,
'type'
:
'IntegerField'
,
},
}
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
self
.
assertEqual
(
response
.
data
,
expected
)
self
.
assertEqual
(
response
.
data
,
expected
)
...
...
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