Commit 563888b8 authored by Patrick James Ong's avatar Patrick James Ong

Added self to browser.get and added /hero/ in tests and urls

parent 8edb4d56
Pipeline #830 canceled with stages
......@@ -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')
......@@ -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'),
]
......@@ -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')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment