hopefully final or near the final commit for the lab

parent 12c13eb2
......@@ -27,13 +27,35 @@ class NewVisitorTest(unittest.TestCase):
self.assertEqual(detail.get_attribute('innerHTML'), '600')
detail = self.browser.find_element_by_id('cloudAttack')
self.assertEqual(detail.get_attribute('innerHTML'), '57')
detail = self.browser.find_element_by_id('jesterName')
self.assertEqual(detail.get_attribute('innerHTML'), 'Jester')
detail = self.browser.find_element_by_id('jesterHealth')
self.assertEqual(detail.get_attribute('innerHTML'), '660')
detail = self.browser.find_element_by_id('jesterAttack')
self.assertEqual(detail.get_attribute('innerHTML'), '64')
detail = self.browser.find_element_by_id('sunName')
self.assertEqual(detail.get_attribute('innerHTML'), 'Sunflowey')
detail = self.browser.find_element_by_id('sunHealth')
self.assertEqual(detail.get_attribute('innerHTML'), '650')
detail = self.browser.find_element_by_id('sunAttack')
self.assertEqual(detail.get_attribute('innerHTML'), '43')
# 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')
# She spots the page title and header mentions the name of the hero she selected.
detail = self.browser.find_element_by_id('cloudtitle')
self.assertEqual(detail.get_attribute('innerHTML'), 'Detail - Cloud')
detail = self.browser.find_element_by_id('cloudheading')
self.assertEqual(detail.get_attribute('innerHTML'), 'Detail - Cloud')
# 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.
button = self.browser.find_element_by_id('button').click()
#self.assertEqual(resolve('/').func, home)
self.fail('Finish the test!')
......
# from django.shortcuts import render
# def home_page(request):
# return render(request, 'heroes/home_page.html')
# def cloud(request):
# return render(request, 'heroes/detail_cloud.html')
# def jester(request):
# return render(request, 'heroes/detail_jester.html')
# def sunflowey(request):
# return render(request, 'heroes/detail_sunflowey.html')
from django.views.generic.base import TemplateView
class HomeView(TemplateView):
......
<!DOCTYPE html>
<html>
<head>
<title>Detail - Cloud</title>
<title id='cloudtitle'>Detail - Cloud</title>
</head>
<body>
<img src="./cloud.png" style="width: 10vw;" />
<h1>Detail - Cloud</h1>
<img src="https://opengameart.org/sites/default/files/styles/medium/public/bigvioletcloud_0.png" style="width: 10vw;" />
<h1 id='cloudheading'>Detail - Cloud</h1>
<dl>
<dt>Health Points</dt><dd>600</dd>
<dt>Base Attack Damage</dt><dd>57</dd>
......
......@@ -4,7 +4,7 @@
<title>Detail - Jester</title>
</head>
<body>
<img src="./jester.png" style="width: 10vw;"/>
<img src="https://opengameart.org/sites/default/files/styles/medium/public/jester.png" style="width: 10vw;"/>
<h1>Detail - Jester</h1>
<dl>
<dt>Health Points</dt><dd>660</dd>
......
......@@ -4,7 +4,7 @@
<title>Detail - Sunflowey</title>
</head>
<body>
<img src="./sunflowey.png" style="width: 10vw;" />
<img src="https://opengameart.org/sites/default/files/styles/medium/public/sunflower_plant_enemy_game_character_sprites.jpg" style="width: 10vw;" />
<h1>Detail - Sunflowey</h1>
<dl>
<dt>Health Points</dt><dd>650</dd>
......
"""willowisp URL Configuration
"""
willowisp URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
......
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