Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS Lab
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
Li Niko M. Arceo
CS Lab
Commits
9a74a03d
Commit
9a74a03d
authored
Mar 06, 2020
by
Li Niko M. Arceo
🦈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
details on heroes page are checked
parent
57e1a12c
Pipeline
#748
canceled with stages
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
5 deletions
+29
-5
tests.cpython-38.pyc
heroes/__pycache__/tests.cpython-38.pyc
+0
-0
urls.cpython-38.pyc
heroes/__pycache__/urls.cpython-38.pyc
+0
-0
detail_cloud.html
heroes/templates/detail_cloud.html
+1
-1
tests.py
heroes/tests.py
+6
-1
urls.py
heroes/urls.py
+2
-2
lab1_functional_test.py
lab1_functional_test.py
+20
-1
No files found.
heroes/__pycache__/tests.cpython-38.pyc
View file @
9a74a03d
No preview for this file type
heroes/__pycache__/urls.cpython-38.pyc
View file @
9a74a03d
No preview for this file type
heroes/templates/detail_cloud.html
View file @
9a74a03d
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
Detail - Cloud
</title>
<title>
Detail - Cloud
</title>
...
...
heroes/tests.py
View file @
9a74a03d
...
@@ -9,6 +9,11 @@ class HomePageTest(TestCase):
...
@@ -9,6 +9,11 @@ class HomePageTest(TestCase):
response
=
self
.
client
.
get
(
'/'
)
response
=
self
.
client
.
get
(
'/'
)
self
.
assertTemplateUsed
(
response
,
'home.html'
)
self
.
assertTemplateUsed
(
response
,
'home.html'
)
class
HeroTemplateTest
(
TestCase
):
def
test_uses_home_template
(
self
):
response
=
self
.
client
.
get
(
'/heroes'
)
self
.
assertTemplateUsed
(
response
,
'heroes.html'
)
class
CloudTemplateTest
(
TestCase
):
class
CloudTemplateTest
(
TestCase
):
...
...
heroes/urls.py
View file @
9a74a03d
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
from
django.conf.urls
import
url
from
django.conf.urls
import
url
from
.views
import
HomeView
,
CloudView
,
JesterView
,
SunfloweyView
from
.views
import
HomeView
,
HeroesView
,
CloudView
,
JesterView
,
SunfloweyView
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^$'
,
HomeView
.
as_view
(),
name
=
'home'
),
url
(
r'^$'
,
HomeView
.
as_view
(),
name
=
'home'
),
url
(
r'^heroes$'
,
H
ome
View
.
as_view
(),
name
=
'heroes'
),
url
(
r'^heroes$'
,
H
eroes
View
.
as_view
(),
name
=
'heroes'
),
url
(
r'^heroes/cloud$'
,
CloudView
.
as_view
(),
name
=
'cloud'
),
url
(
r'^heroes/cloud$'
,
CloudView
.
as_view
(),
name
=
'cloud'
),
url
(
r'^heroes/jester$'
,
JesterView
.
as_view
(),
name
=
'jester'
),
url
(
r'^heroes/jester$'
,
JesterView
.
as_view
(),
name
=
'jester'
),
url
(
r'^heroes/sunflowey$'
,
SunfloweyView
.
as_view
(),
name
=
'sunflowey'
),
url
(
r'^heroes/sunflowey$'
,
SunfloweyView
.
as_view
(),
name
=
'sunflowey'
),
...
...
lab1_functional_test.py
View file @
9a74a03d
...
@@ -19,6 +19,25 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -19,6 +19,25 @@ class NewVisitorTest(unittest.TestCase):
# She sees a list containing three heroes with their corresponding
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
# names, health points, and damage
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
element
=
self
.
browser
.
find_element_by_id
(
'cloud-name'
)
self
.
assertEqual
(
element
.
get_attribute
(
'placeholder'
),
'Name: Cloud'
)
element
=
self
.
browser
.
find_element_by_id
(
'cloud-hp'
)
self
.
assertEqual
(
element
.
get_attribute
(
'placeholder'
),
'HP: 600'
)
element
=
self
.
browser
.
find_element_by_id
(
'cloud-dmg'
)
self
.
assertEqual
(
element
.
get_attribute
(
'placeholder'
),
'Dmg: 57'
)
element
=
self
.
browser
.
find_element_by_id
(
'jester-name'
)
self
.
assertEqual
(
element
.
get_attribute
(
'placeholder'
),
'Name: Jester'
)
element
=
self
.
browser
.
find_element_by_id
(
'jester-hp'
)
self
.
assertEqual
(
element
.
get_attribute
(
'placeholder'
),
'HP: 660'
)
element
=
self
.
browser
.
find_element_by_id
(
'jester-dmg'
)
self
.
assertEqual
(
element
.
get_attribute
(
'placeholder'
),
'Dmg: 64'
)
element
=
self
.
browser
.
find_element_by_id
(
'sunflowey-name'
)
self
.
assertEqual
(
element
.
get_attribute
(
'placeholder'
),
'Name: Sunflowey'
)
element
=
self
.
browser
.
find_element_by_id
(
'sunflowey-hp'
)
self
.
assertEqual
(
element
.
get_attribute
(
'placeholder'
),
'HP: 650'
)
element
=
self
.
browser
.
find_element_by_id
(
'sunflowey-dmg'
)
self
.
assertEqual
(
element
.
get_attribute
(
'placeholder'
),
'Dmg: 43'
)
# When she selects one of the heroes, she is sent to another page
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
# containing more information about the hero (additional stats, lore, image).
...
...
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