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
2e481f33
Commit
2e481f33
authored
Mar 12, 2013
by
Dave Kuhn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for X-HTTP-Method-Override header
parent
104614c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
rest_framework/tests/request.py
+8
-0
No files found.
rest_framework/tests/request.py
View file @
2e481f33
...
@@ -58,6 +58,14 @@ class TestMethodOverloading(TestCase):
...
@@ -58,6 +58,14 @@ class TestMethodOverloading(TestCase):
request
=
Request
(
factory
.
post
(
'/'
,
{
api_settings
.
FORM_METHOD_OVERRIDE
:
'DELETE'
}))
request
=
Request
(
factory
.
post
(
'/'
,
{
api_settings
.
FORM_METHOD_OVERRIDE
:
'DELETE'
}))
self
.
assertEqual
(
request
.
method
,
'DELETE'
)
self
.
assertEqual
(
request
.
method
,
'DELETE'
)
def
test_x_http_method_override_header
(
self
):
"""
POST requests can also be overloaded to another method by setting
the X-HTTP-Method-Override header.
"""
request
=
Request
(
factory
.
post
(
'/'
,
{
'foo'
:
'bar'
},
HTTP_X_HTTP_METHOD_OVERRIDE
=
'DELETE'
))
self
.
assertEqual
(
request
.
method
,
'DELETE'
)
class
TestContentParsing
(
TestCase
):
class
TestContentParsing
(
TestCase
):
def
test_standard_behaviour_determines_no_content_GET
(
self
):
def
test_standard_behaviour_determines_no_content_GET
(
self
):
...
...
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