Commit 9a74a03d authored by Li Niko M. Arceo's avatar Li Niko M. Arceo 🦈

details on heroes page are checked

parent 57e1a12c
Pipeline #748 canceled with stages
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<title>Detail - Cloud</title>
......
......@@ -8,7 +8,12 @@ class HomePageTest(TestCase):
def test_uses_home_template(self):
response = self.client.get('/')
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):
......
......@@ -2,11 +2,11 @@
from django.conf.urls import url
from .views import HomeView, CloudView, JesterView, SunfloweyView
from .views import HomeView, HeroesView, CloudView, JesterView, SunfloweyView
urlpatterns = [
url(r'^$', HomeView.as_view(), name='home'),
url(r'^heroes$', HomeView.as_view(), name='heroes'),
url(r'^heroes$', HeroesView.as_view(), name='heroes'),
url(r'^heroes/cloud$', CloudView.as_view(), name='cloud'),
url(r'^heroes/jester$', JesterView.as_view(), name='jester'),
url(r'^heroes/sunflowey$', SunfloweyView.as_view(), name='sunflowey'),
......
......@@ -19,7 +19,26 @@ class NewVisitorTest(unittest.TestCase):
# She sees a list containing three heroes with their corresponding
# 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
# containing more information about the hero (additional stats, lore, image).
......
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