Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
willowisp_valenzuela
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
Anton Ralph Valenzuela
willowisp_valenzuela
Commits
0667c726
Commit
0667c726
authored
Mar 06, 2020
by
Anton Ralph F. Valenzuela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added other three unit tests.
parent
abe006a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
functional_tests.py
functional_tests.py
+10
-1
tests.py
heroes/tests.py
+12
-0
views.py
heroes/views.py
+3
-3
No files found.
functional_tests.py
View file @
0667c726
...
...
@@ -29,7 +29,16 @@ class NewVisitorTest(unittest.TestCase):
# While she is in a specific hero's page, she sees a button labeled "Back to Heroes List".
# She clicks this and she is redirected back to the wiki's homepage.
self
.
browser
.
get
(
'http://localhost:8000'
)
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
# She decides to do it again UwU
self
.
browser
.
get
(
'http://localhost:8000/hero/sunflowey'
)
self
.
assertIn
(
'Detail - Sunflowey'
,
self
.
browser
.
title
)
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
self
.
browser
.
get
(
'http://localhost:8000/hero/jester'
)
self
.
assertIn
(
'Detail - Jester'
,
self
.
browser
.
title
)
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
self
.
fail
(
'Finish the test!'
)
...
...
heroes/tests.py
View file @
0667c726
...
...
@@ -5,3 +5,15 @@ class HomePageTest(TestCase):
def
test_heroes_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/heroes/'
)
self
.
assertTemplateUsed
(
response
,
'heroes.html'
)
def
test_cloud_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/cloud'
)
self
.
assertTemplateUsed
(
response
,
'detail_cloud.html'
)
def
test_sunflowey_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/sunflowey'
)
self
.
assertTemplateUsed
(
response
,
'detail_sunflowey.html'
)
def
test_jester_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/hero/jester'
)
self
.
assertTemplateUsed
(
response
,
'detail_jester.html'
)
heroes/views.py
View file @
0667c726
...
...
@@ -4,10 +4,10 @@ def heroes_page(request):
return
render
(
request
,
'heroes.html'
)
def
cloud_page
(
request
):
pass
return
render
(
request
,
'detail_cloud.html'
)
def
sunflowey_page
(
request
):
pass
return
render
(
request
,
'detail_sunflowey.html'
)
def
jester_page
(
request
):
pass
return
render
(
request
,
'detail_jester.html'
)
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