Commit a9297cdc authored by Joaquin's avatar Joaquin

Finish

parent 44e837b2
File added
This diff is collapsed.
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<title>Detail - Cloud</title> <title>Detail - Cloud</title>
</head> </head>
<body> <body>
<img src="./cloud.png" style="width: 10vw;" /> <img id='hero_image' src="./cloud.png" style="width: 10vw;" />
<h1>Detail - Cloud</h1> <h1>Detail - Cloud</h1>
<dl> <dl>
<dt>Health Points</dt><dd>600</dd> <dt id='hero_health'>Health Points</dt><dd>600</dd>
<dt>Base Attack Damage</dt><dd>57</dd> <dt id='hero_attack'>Base Attack Damage</dt><dd>57</dd>
<dt>Skills</dt><dd>Nimbus, Rain Cloud, Thunderbolt</dd> <dt id='hero_skills'>Skills</dt><dd>Nimbus, Rain Cloud, Thunderbolt</dd>
<dt>Lore</dt><dd>I am a cloud. When I pee you call it 'rain'.</dd> <dt id='hero_lore'>Lore</dt><dd>I am a cloud. When I pee you call it 'rain'.</dd>
</dl> </dl>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<title>Detail - Jester</title> <title>Detail - Jester</title>
</head> </head>
<body> <body>
<img src="./jester.png" style="width: 10vw;"/> <img id='hero_image' src="./jester.png" style="width: 10vw;"/>
<h1>Detail - Jester</h1> <h1>Detail - Jester</h1>
<dl> <dl>
<dt>Health Points</dt><dd>660</dd> <dt id='hero_health'>Health Points</dt><dd>660</dd>
<dt>Base Attack Damage</dt><dd>64</dd> <dt id='hero_attack'>Base Attack Damage</dt><dd>64</dd>
<dt>Skills</dt><dd>Laugh, Dance, Smile</dd> <dt id='hero_skills'>Skills</dt><dd>Laugh, Dance, Smile</dd>
<dt>Lore</dt><dd>I do it for the LOLs.</dd> <dt id='hero_lore'>Lore</dt><dd>I do it for the LOLs.</dd>
</dl> </dl>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<title>Detail - Sunflowey</title> <title>Detail - Sunflowey</title>
</head> </head>
<body> <body>
<img src="./sunflowey.png" style="width: 10vw;" /> <img id='hero_image' src="./sunflowey.png" style="width: 10vw;" />
<h1>Detail - Sunflowey</h1> <h1>Detail - Sunflowey</h1>
<dl> <dl>
<dt>Health Points</dt><dd>650</dd> <dt id='hero_health'>Health Points</dt><dd>650</dd>
<dt>Base Attack Damage</dt><dd>43</dd> <dt id='hero_attack'>Base Attack Damage</dt><dd>43</dd>
<dt>Skills</dt><dd>Power Pellet, Sunshine, Pollen Punch</dd> <dt id='hero_skills'>Skills</dt><dd>Power Pellet, Sunshine, Pollen Punch</dd>
<dt>Lore</dt><dd>I am Sunflowey. Sometimes a sun, sometimes a flower.</dd> <dt id='hero_lore'>Lore</dt><dd>I am Sunflowey. Sometimes a sun, sometimes a flower.</dd>
</dl> </dl>
</body> </body>
</html> </html>
\ No newline at end of file
<!DOCTYPE html>
<html> <html>
<head> <head><title>The Will of the Wisps Wikis</title></head>
<title>The Will of the Wisps Wikis</title>
</head>
<body>
</body>
</html> </html>
\ No newline at end of file
from django.test import TestCase from django.test import TestCase
# Create your tests here.
class heroTest(TestCase):
def detail_cloud.html(self): class heroesTest(TestCase):
def test_heroes_link_returns_correct_html(self):
response = self.client.get('/heroes') response = self.client.get('/heroes')
self.assertTemplateUsed(response, 'heroes.html') self.assertTemplateUsed(response, 'heroes.html')
class heroCloudTest(TestCase): class heroCloudTest(TestCase):
def test_hero_cloud_page_returns_correct_html(self): def test_hero_cloud_page_returns_correct_html(self):
response = self.client.get('/hero/cloud') response = self.client.get('/hero/cloud')
self.assertTemplateUsed(response, 'detail_cloud.html') self.assertTemplateUsed(response, 'detail_cloud.html')
class heroSunFloweyTest(TestCase):
class heroSunfloweyTest(TestCase):
def test_hero_sunflowey_page_returns_correct_html(self): def test_hero_sunflowey_page_returns_correct_html(self):
response = self.client.get('/hero/sunflowey') response = self.client.get('/hero/sunflowey')
self.assertTemplateUsed(response, 'detail_sunflowey.html') self.assertTemplateUsed(response, 'detail_sunflowey.html')
class heroJesterTest(TestCase): class heroJesterTest(TestCase):
def test_hero_jester_page_returns_correct_html(self): def test_hero_jester_page_returns_correct_html(self):
response = self.client.get('/hero/jester') response = self.client.get('/hero/jester')
self.assertTemplateUsed(response, 'detail_jester.html') self.assertTemplateUsed(response, 'detail_jester.html')#
...@@ -3,8 +3,8 @@ from django.conf.urls import url ...@@ -3,8 +3,8 @@ from django.conf.urls import url
from .views import HeroesView, CloudView, SunfloweyView, JesterView from .views import HeroesView, CloudView, SunfloweyView, JesterView
urlpatterns = [ urlpatterns = [
url(r'^heroes$', HeroesView.as_view(), name='heroes_show'), url(r'^heroes$', HeroesView.as_view(), name='heroes_show'),
url(r'^hero/clouds$', CloudView.as_view(), name='cloud_show'), url(r'^hero/cloud$', CloudView.as_view(), name='cloud_show'),
url(r'^hero/sunflowey$', SunfloweyView.as_view(), name='sunflowey_show'), url(r'^hero/sunflowey$', SunfloweyView.as_view(), name='sunflowey_show'),
url(r'^hero/jester$', JesterView.as_view(), name='jester_show'), url(r'^hero/jester$', JesterView.as_view(), name='jester_show'),
] ]
\ No newline at end of file
from django.shortcuts import render from django.views.generic.base import TemplateView
# Create your views here.
class HeroesView(TemplateView):
template_name = 'heroes.html'
class CloudView(TemplateView):
template_name = 'detail_cloud.html'
class SunfloweyView(TemplateView):
template_name = 'detail_sunflowey.html'
class JesterView(TemplateView):
template_name = 'detail_jester.html'
\ No newline at end of file
...@@ -19,7 +19,8 @@ class NewVisitorTest(unittest.TestCase): ...@@ -19,7 +19,8 @@ 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.assertIn(self.browser.current_url, 'http://localhost:8000/heroes') self.assertIn(self.browser.current_url,
'http://localhost:8000/heroes')
# 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).
...@@ -27,13 +28,13 @@ class NewVisitorTest(unittest.TestCase): ...@@ -27,13 +28,13 @@ class NewVisitorTest(unittest.TestCase):
self.assertIn('Health Points', self.browser.find_element_by_id('hero_health').text) self.assertIn('Health Points', self.browser.find_element_by_id('hero_health').text)
self.assertIn('Base Attack Damage', self.browser.find_element_id('hero_attack').text) self.assertIn('Base Attack Damage', self.browser.find_element_by_id('hero_attack').text)
self.assertIn('Skills', self.browser.find_element_id('hero_skills').text) self.assertIn('Skills', self.browser.find_element_by_id('hero_skills').text)
self.assertIn('Lore', self.browser.find_element_id('hero_lore').text) self.assertIn('Lore', self.browser.find_element_by_id('hero_lore').text)
self.assertIn('.png', self.browser.find_element_id('hero_image').get_attribute('src')) self.assertIn('.png', self.browser.find_element_by_id('hero_image').get_attribute('src'))
# She spots the page title and header mentions the name of the hero she selected. # She spots the page title and header mentions the name of the hero she selected.
self.assertIn('Detail - ', self.browser.title) self.assertIn('Detail - ', self.browser.title)
......
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