Commit c845fe22 authored by Jay Lopez's avatar Jay Lopez

finished loading of homepage, begin dealing with detail pages

parent b517844a
...@@ -13,7 +13,7 @@ class NewVisitorTest(unittest.TestCase): ...@@ -13,7 +13,7 @@ class NewVisitorTest(unittest.TestCase):
def test_can_display_a_heroes_list_and_more_information_per_hero(self): 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. # Widget has heard about a new wiki app for the game called The Will of the Wisps.
# She goes to check out its homepage # She goes to check out its homepage
self.browser.get('https://localhost:8000/heroes') self.browser.get('http://localhost:8000/heroes')
# She notices the page title and header mention # She notices the page title and header mention
# 'The Will of the Wisps Wiki' # 'The Will of the Wisps Wiki'
...@@ -41,6 +41,7 @@ class NewVisitorTest(unittest.TestCase): ...@@ -41,6 +41,7 @@ class NewVisitorTest(unittest.TestCase):
self.assertIn('/heroes', self.browser.current_url) self.assertIn('/heroes', self.browser.current_url)
self.fail('Finish the test!') self.fail('Finish the test!')
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(warnings='ignore') unittest.main(warnings='ignore')
\ No newline at end of file
<html>
<title>The Will of the Wisps Wiki</title>
<h1>Will of the Wisps</h1>
<h4>Heroes</h4>
<ul>
<li><a href='/hero/cloud/'>Cloud (600 HP, 57 ATK)</a></li>
<li><a href='/hero/jester/'>Jester (660 HP, 64 ATK)</a></li>
<li><a href='/hero/sunflowey/'>Sunflowey (650 HP, 43 ATK)</a></li>
</ul>
</html>
\ No newline at end of file
...@@ -2,5 +2,8 @@ from django.conf.urls import url ...@@ -2,5 +2,8 @@ from django.conf.urls import url
from .views import * from .views import *
urlpatterns = [ urlpatterns = [
url(r'^heroes$', HomeView.as_view(), name='index'),
url(r'^hero/cloud$', CloudView.as_view()),
url(r'^hero/sunflowey$', SunfloweyView.as_view()),
url(r'^hero/jester$', JesterView.as_view())
] ]
\ No newline at end of file
from django.shortcuts import render from django.shortcuts import render
from django.generic.base import TemplateView from django.views.generic.base import TemplateView
# Create your views here. # Create your views here.
class HomeView(TemplateView): class HomeView(TemplateView):
template_name = 'home.html' template_name = 'index.html'
\ No newline at end of file
class CloudView(TemplateView):
template_name = 'detail_cloud.html'
class JesterView(TemplateView):
template_name = 'detail_jester.html'
class SunfloweyView(TemplateView):
template_name = 'detail_sunflowey.html'
\ No newline at end of file
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