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
79c1f215
Commit
79c1f215
authored
Aug 30, 2017
by
Ryan P Kilby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix authorization few perms tests
parent
ff2fa7a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tests/test_permissions.py
+3
-3
No files found.
tests/test_permissions.py
View file @
79c1f215
...
@@ -201,11 +201,11 @@ class ModelPermissionsIntegrationTests(TestCase):
...
@@ -201,11 +201,11 @@ class ModelPermissionsIntegrationTests(TestCase):
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
def
test_calling_method_not_allowed
(
self
):
def
test_calling_method_not_allowed
(
self
):
request
=
factory
.
generic
(
'METHOD_NOT_ALLOWED'
,
'/'
)
request
=
factory
.
generic
(
'METHOD_NOT_ALLOWED'
,
'/'
,
HTTP_AUTHORIZATION
=
self
.
permitted_credentials
)
response
=
root_view
(
request
)
response
=
root_view
(
request
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_405_METHOD_NOT_ALLOWED
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_405_METHOD_NOT_ALLOWED
)
request
=
factory
.
generic
(
'METHOD_NOT_ALLOWED'
,
'/1'
)
request
=
factory
.
generic
(
'METHOD_NOT_ALLOWED'
,
'/1'
,
HTTP_AUTHORIZATION
=
self
.
permitted_credentials
)
response
=
instance_view
(
request
,
pk
=
'1'
)
response
=
instance_view
(
request
,
pk
=
'1'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_405_METHOD_NOT_ALLOWED
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_405_METHOD_NOT_ALLOWED
)
...
@@ -396,7 +396,7 @@ class ObjectPermissionsIntegrationTests(TestCase):
...
@@ -396,7 +396,7 @@ class ObjectPermissionsIntegrationTests(TestCase):
self
.
assertListEqual
(
response
.
data
,
[])
self
.
assertListEqual
(
response
.
data
,
[])
def
test_cannot_method_not_allowed
(
self
):
def
test_cannot_method_not_allowed
(
self
):
request
=
factory
.
generic
(
'METHOD_NOT_ALLOWED'
,
'/'
)
request
=
factory
.
generic
(
'METHOD_NOT_ALLOWED'
,
'/'
,
HTTP_AUTHORIZATION
=
self
.
credentials
[
'readonly'
]
)
response
=
object_permissions_list_view
(
request
)
response
=
object_permissions_list_view
(
request
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_405_METHOD_NOT_ALLOWED
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_405_METHOD_NOT_ALLOWED
)
...
...
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