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
ed1251d3
Commit
ed1251d3
authored
Mar 07, 2020
by
Patrick James Ong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished storyline part 4
parent
c6c87b6b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
views.py
willowisp/heroes/views.py
+5
-5
lab1_functional_test.py
willowisp/lab1_functional_test.py
+7
-4
No files found.
willowisp/heroes/views.py
View file @
ed1251d3
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.views.generic.base
import
TemplateView
from
django.views.generic.list
import
ListView
f
rom
django.views.generic.detail
import
DetailView
#
from django.views.generic.list import ListView
#
rom django.views.generic.detail import DetailView
# Create your views here.
class
HomeListView
(
TemplateView
):
template_name
=
'home.html'
class
CloudDetailView
(
Detail
View
):
class
CloudDetailView
(
Template
View
):
template_name
=
'detail_cloud.html'
class
JesterDetailView
(
Detail
View
):
class
JesterDetailView
(
Template
View
):
template_name
=
'detail_jester.html'
class
SunfloweyDetailView
(
Detail
View
):
class
SunfloweyDetailView
(
Template
View
):
template_name
=
'detail_sunflowey.html'
willowisp/lab1_functional_test.py
View file @
ed1251d3
from
selenium
import
webdriver
import
unittest
import
time
class
NewVisitorTest
(
unittest
.
TestCase
):
...
...
@@ -35,20 +36,22 @@ 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/cloud')
self
.
browser
.
get
(
'http://localhost:8000/hero/cloud'
)
#self.browser.get('http://localhost:8000/hero/sunflowey')
#self.browser.get('http://localhost:8000/hero/jester')
# She spots the page title and header mentions the name of the hero she selected.
#
self.assertIn('Cloud', self.browser.title)
self
.
assertIn
(
'Cloud'
,
self
.
browser
.
title
)
#self.assertIn('Sunflowey', self.browser.title)
#self.assertIn('Jester', self.browser.title)
time
.
sleep
(
1
)
# 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'
)
time
.
sleep
(
1
)
#
self.fail('Finish the test!')
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