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
65611781
Commit
65611781
authored
Jan 28, 2014
by
Xavier Ordoquy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Django 1.7 has new 404 and 403 body messages.
parent
23a20160
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
rest_framework/tests/test_htmlrenderer.py
+4
-2
No files found.
rest_framework/tests/test_htmlrenderer.py
View file @
65611781
...
@@ -108,11 +108,13 @@ class TemplateHTMLRendererExceptionTests(TestCase):
...
@@ -108,11 +108,13 @@ class TemplateHTMLRendererExceptionTests(TestCase):
def
test_not_found_html_view_with_template
(
self
):
def
test_not_found_html_view_with_template
(
self
):
response
=
self
.
client
.
get
(
'/not_found'
)
response
=
self
.
client
.
get
(
'/not_found'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_404_NOT_FOUND
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_404_NOT_FOUND
)
self
.
assertEqual
(
response
.
content
,
six
.
b
(
"404: Not found"
))
self
.
assertTrue
(
response
.
content
in
(
six
.
b
(
"404: Not found"
),
six
.
b
(
"404 Not Found"
)))
self
.
assertEqual
(
response
[
'Content-Type'
],
'text/html; charset=utf-8'
)
self
.
assertEqual
(
response
[
'Content-Type'
],
'text/html; charset=utf-8'
)
def
test_permission_denied_html_view_with_template
(
self
):
def
test_permission_denied_html_view_with_template
(
self
):
response
=
self
.
client
.
get
(
'/permission_denied'
)
response
=
self
.
client
.
get
(
'/permission_denied'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_403_FORBIDDEN
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_403_FORBIDDEN
)
self
.
assertEqual
(
response
.
content
,
six
.
b
(
"403: Permission denied"
))
self
.
assertTrue
(
response
.
content
in
(
six
.
b
(
"403: Permission denied"
),
six
.
b
(
"403 Forbidden"
)))
self
.
assertEqual
(
response
[
'Content-Type'
],
'text/html; charset=utf-8'
)
self
.
assertEqual
(
response
[
'Content-Type'
],
'text/html; charset=utf-8'
)
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