Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
will-o-wisp
Project
Project
Details
Activity
Releases
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
Santino Campos
will-o-wisp
Commits
faecbea6
Commit
faecbea6
authored
Mar 07, 2020
by
Santino Campos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for validating redirecting view on empty url
parent
fc8afb2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
tests.py
heroes/tests.py
+6
-1
No files found.
heroes/tests.py
View file @
faecbea6
from
django.test
import
TestCase
from
django.test
import
TestCase
from
.views
import
redirect_view
class
HomePageTest
(
TestCase
):
class
HomePageTest
(
TestCase
):
...
@@ -15,10 +17,13 @@ class HomePageTest(TestCase):
...
@@ -15,10 +17,13 @@ class HomePageTest(TestCase):
jester_detail_response
=
self
.
client
.
get
(
"/hero/jester"
)
jester_detail_response
=
self
.
client
.
get
(
"/hero/jester"
)
self
.
assertTemplateUsed
(
jester_detail_response
,
'detail_jester.html'
)
self
.
assertTemplateUsed
(
jester_detail_response
,
'detail_jester.html'
)
def
test_cloud_url_returns_valid_template
(
self
):
def
test_cloud_url_returns_valid_template
(
self
):
cloud_detail_response
=
self
.
client
.
get
(
"/hero/cloud"
)
cloud_detail_response
=
self
.
client
.
get
(
"/hero/cloud"
)
self
.
assertTemplateUsed
(
cloud_detail_response
,
'detail_cloud.html'
)
self
.
assertTemplateUsed
(
cloud_detail_response
,
'detail_cloud.html'
)
def
test_blank_url_redirects
(
self
):
redirect_response
=
self
.
client
.
get
(
"/"
)
self
.
assertEqual
(
redirect_response
.
url
,
'/heroes'
)
...
...
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