Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
Lab1-Willowisp
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
Patrick James Ong
Lab1-Willowisp
Commits
563888b8
Commit
563888b8
authored
Mar 06, 2020
by
Patrick James Ong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added self to browser.get and added /hero/ in tests and urls
parent
8edb4d56
Pipeline
#830
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
9 deletions
+13
-9
tests.py
willowisp/heroes/tests.py
+3
-3
urls.py
willowisp/heroes/urls.py
+3
-3
lab1_functional_test.py
willowisp/lab1_functional_test.py
+7
-3
No files found.
willowisp/heroes/tests.py
View file @
563888b8
...
...
@@ -13,19 +13,19 @@ class HomePageTest(TestCase):
class
CloudPageTest
(
TestCase
):
def
test_uses_hero_template
(
self
):
response
=
self
.
client
.
get
(
'/cloud/'
)
response
=
self
.
client
.
get
(
'/
hero/
cloud/'
)
self
.
assertTemplateUsed
(
response
,
'detail_cloud.html'
)
class
JesterPageTest
(
TestCase
):
def
test_uses_hero_template
(
self
):
response
=
self
.
client
.
get
(
'/jester/'
)
response
=
self
.
client
.
get
(
'/
hero/
jester/'
)
self
.
assertTemplateUsed
(
response
,
'detailed_jester.html'
)
class
SunfloweyPageTest
(
TestCase
):
def
test_uses_hero_template
(
self
):
response
=
self
.
client
.
get
(
'/sunflowey/'
)
response
=
self
.
client
.
get
(
'/
hero/
sunflowey/'
)
self
.
assertTemplateUsed
(
response
,
'detailed_sunflowey.html'
)
willowisp/heroes/urls.py
View file @
563888b8
...
...
@@ -4,7 +4,7 @@ from .views import HomeListView, CloudDetailView, JesterDetailView, SunfloweyDet
urlpatterns
=
[
url
(
r'^$'
,
HomeListView
.
as_view
(),
name
=
'home'
),
url
(
r'^cloud/$'
,
CloudDetailView
.
as_view
(),
name
=
'detail_cloud'
),
url
(
r'^jester/$'
,
JesterDetailView
.
as_view
(),
name
=
'detail_jester'
),
url
(
r'^sunflowey/$'
,
SunfloweyDetailView
.
as_view
(),
name
=
'detail_sunflowey'
),
url
(
r'^
hero/
cloud/$'
,
CloudDetailView
.
as_view
(),
name
=
'detail_cloud'
),
url
(
r'^
hero/
jester/$'
,
JesterDetailView
.
as_view
(),
name
=
'detail_jester'
),
url
(
r'^
hero/
sunflowey/$'
,
SunfloweyDetailView
.
as_view
(),
name
=
'detail_sunflowey'
),
]
willowisp/lab1_functional_test.py
View file @
563888b8
...
...
@@ -2,8 +2,9 @@ from selenium import webdriver
import
unittest
class
NewVisitorTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
browser
=
webdriver
.
Firefox
()
self
.
browser
=
webdriver
.
Chrome
()
def
tearDown
(
self
):
self
.
browser
.
quit
()
...
...
@@ -11,7 +12,7 @@ class NewVisitorTest(unittest.TestCase):
def
test_can_display_a_heroes_list_and_more_information_per_hero
(
self
):
# Widget has heard about a new wiki app for the game called The Will of the Wisps.
# She goes to check out its homepage
browser
.
get
(
'http://localhost:8000'
)
self
.
browser
.
get
(
'http://localhost:8000'
)
# She notices the page title and header mention
# 'The Will of the Wisps Wiki'
...
...
@@ -44,6 +45,9 @@ 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.
browser
.
get
(
'http://localhost:8000'
)
self
.
browser
.
get
(
'http://localhost:8000'
)
self
.
fail
(
'Finish the test!'
)
if
__name__
==
'__main__'
:
unittest
.
main
(
warnings
=
'ignore'
)
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