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
a90e447f
Commit
a90e447f
authored
Mar 07, 2020
by
Santino Campos
Browse files
Options
Browse Files
Download
Plain Diff
Fix merge conflict between master and feat_hero_details
parents
8dc2f81a
1b0a569d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
144 additions
and
1 deletion
+144
-1
cloud.png
heroes/templates/cloud.png
+0
-0
detail_cloud.html
heroes/templates/detail_cloud.html
+16
-0
detail_jester.html
heroes/templates/detail_jester.html
+16
-0
detail_sunflowey.html
heroes/templates/detail_sunflowey.html
+16
-0
jester.png
heroes/templates/jester.png
+0
-0
sunflowey.png
heroes/templates/sunflowey.png
+0
-0
tests.py
heroes/tests.py
+17
-0
urls.py
heroes/urls.py
+7
-0
views.py
heroes/views.py
+9
-0
lab1_functional_test.py
lab1_functional_test.py
+63
-1
No files found.
heroes/templates/cloud.png
0 → 100644
View file @
a90e447f
6.92 KB
heroes/templates/detail_cloud.html
0 → 100644
View file @
a90e447f
<!DOCTYPE html>
<html>
<head>
<title>
Detail - Cloud
</title>
</head>
<body>
<img
src=
"./cloud.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Cloud
</h1>
<dl>
<dt>
Health Points
</dt><dd>
600
</dd>
<dt>
Base Attack Damage
</dt><dd>
57
</dd>
<dt>
Skills
</dt><dd>
Nimbus, Rain Cloud, Thunderbolt
</dd>
<dt>
Lore
</dt><dd>
I am a cloud. When I pee you call it 'rain'.
</dd>
</dl>
</body>
</html>
\ No newline at end of file
heroes/templates/detail_jester.html
0 → 100644
View file @
a90e447f
<!DOCTYPE html>
<html>
<head>
<title>
Detail - Jester
</title>
</head>
<body>
<img
src=
"./jester.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Jester
</h1>
<dl>
<dt>
Health Points
</dt><dd>
660
</dd>
<dt>
Base Attack Damage
</dt><dd>
64
</dd>
<dt>
Skills
</dt><dd>
Laugh, Dance, Smile
</dd>
<dt>
Lore
</dt><dd>
I do it for the LOLs.
</dd>
</dl>
</body>
</html>
\ No newline at end of file
heroes/templates/detail_sunflowey.html
0 → 100644
View file @
a90e447f
<!DOCTYPE html>
<html>
<head>
<title>
Detail - Sunflowey
</title>
</head>
<body>
<img
src=
"./sunflowey.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Sunflowey
</h1>
<dl>
<dt>
Health Points
</dt><dd>
650
</dd>
<dt>
Base Attack Damage
</dt><dd>
43
</dd>
<dt>
Skills
</dt><dd>
Power Pellet, Sunshine, Pollen Punch
</dd>
<dt>
Lore
</dt><dd>
I am Sunflowey. Sometimes a sun, sometimes a flower.
</dd>
</dl>
</body>
</html>
\ No newline at end of file
heroes/templates/jester.png
0 → 100644
View file @
a90e447f
66.3 KB
heroes/templates/sunflowey.png
0 → 100644
View file @
a90e447f
13.9 KB
heroes/tests.py
View file @
a90e447f
...
...
@@ -6,3 +6,20 @@ class HomePageTest(TestCase):
def
test_homepage_url_return_valid_template
(
self
):
homepage_response
=
self
.
client
.
get
(
"/heroes"
)
self
.
assertTemplateUsed
(
homepage_response
,
'homepage.html'
)
def
test_sunflowey_url_returns_valid_template
(
self
):
sunflowey_detail_response
=
self
.
client
.
get
(
"/hero/sunflowey"
)
self
.
assertTemplateUsed
(
sunflowey_detail_response
,
'detail_sunflowey.html'
)
def
test_jester_url_returns_valid_template
(
self
):
jester_detail_response
=
self
.
client
.
get
(
"/hero/jester"
)
self
.
assertTemplateUsed
(
jester_detail_response
,
'detail_jester.html'
)
def
test_cloud_url_returns_valid_template
(
self
):
cloud_detail_response
=
self
.
client
.
get
(
"/hero/cloud"
)
self
.
assertTemplateUsed
(
cloud_detail_response
,
'detail_cloud.html'
)
heroes/urls.py
View file @
a90e447f
...
...
@@ -2,6 +2,13 @@
from
django.conf.urls
import
url
from
.views
import
homepage
from
.views
import
detail_sunflowey
from
.views
import
detail_jester
from
.views
import
detail_cloud
urlpatterns
=
[
url
(
r'^heroes'
,
homepage
,
name
=
'homepage'
),
url
(
r'^hero/sunflowey'
,
detail_sunflowey
,
name
=
'homepage'
),
url
(
r'^hero/jester'
,
detail_jester
,
name
=
'homepage'
),
url
(
r'^hero/cloud'
,
detail_cloud
,
name
=
'homepage'
),
]
heroes/views.py
View file @
a90e447f
...
...
@@ -3,3 +3,12 @@ from django.shortcuts import render
def
homepage
(
request
):
return
render
(
request
,
'homepage.html'
)
def
detail_sunflowey
(
request
):
return
render
(
request
,
'detail_sunflowey.html'
)
def
detail_jester
(
request
):
return
render
(
request
,
'detail_jester.html'
)
def
detail_cloud
(
request
):
return
render
(
request
,
'detail_cloud.html'
)
lab1_functional_test.py
View file @
a90e447f
...
...
@@ -24,7 +24,69 @@ class NewVisitorTest(unittest.TestCase):
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
self
.
browser
.
get
(
'http://localhost:8000/hero/sunflowey'
)
self
.
assertIn
(
'Detail - Sunflowey'
,
self
.
browser
.
title
)
self
.
assertIn
(
'
<html>
<head>
<title>Detail - Sunflowey</title>
</head>
<body>
<img src="./sunflowey.png" style="width: 10vw;" />
<h1>Detail - Sunflowey</h1>
<dl>
<dt>Health Points</dt><dd>650</dd>
<dt>Base Attack Damage</dt><dd>43</dd>
<dt>Skills</dt><dd>Power Pellet, Sunshine, Pollen Punch</dd>
<dt>Lore</dt><dd>I am Sunflowey. Sometimes a sun, sometimes a flower.</dd>
</dl>
</body>
</html>
'
,
self
.
browser
.
page_source
)
self
.
browser
.
get
(
'http://localhost:8000/hero/jester'
)
self
.
assertIn
(
'Detail - Jester'
,
self
.
browser
.
title
)
self
.
assertIn
(
'
<html>
<head>
<title>Detail - Jester</title>
</head>
<body>
<img src="./jester.png" style="width: 10vw;"/>
<h1>Detail - Jester</h1>
<dl>
<dt>Health Points</dt><dd>660</dd>
<dt>Base Attack Damage</dt><dd>64</dd>
<dt>Skills</dt><dd>Laugh, Dance, Smile</dd>
<dt>Lore</dt><dd>I do it for the LOLs.</dd>
</dl>
</body>
</html>
'
,
self
.
browser
.
page_source
)
self
.
browser
.
get
(
'http://localhost:8000/hero/cloud'
)
self
.
assertIn
(
'Detail - Cloud'
,
self
.
browser
.
title
)
self
.
assertIn
(
'<html>
<head>
<title>Detail - Cloud</title>
</head>
<body>
<img src="./cloud.png" style="width: 10vw;" />
<h1>Detail - Cloud</h1>
<dl>
<dt>Health Points</dt><dd>600</dd>
<dt>Base Attack Damage</dt><dd>57</dd>
<dt>Skills</dt><dd>Nimbus, Rain Cloud, Thunderbolt</dd>
<dt>Lore</dt><dd>I am a cloud. When I pee you call it '
rain
'.</dd>
</dl>
</body>
</html>'
,
self
.
browser
.
page_source
)
# She spots the page title and header mentions the name of the hero she selected.
# While she is in a specific hero's page, she sees a button labeled "Back to Heroes List".
...
...
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