Commit 059abcd3 authored by Keith Adrian Santos's avatar Keith Adrian Santos

Added things in views, urls and tests!

parent 2fbe0e7f
<!DOCTYPE html>
<html>
<head>
<title>Detail - Cloud</title>
</head>
<body>
<img src="./cloud.png" style="width: 10vw;" />
<h1>Detail - Cloud</h1>
<dl>
<dt>Health Points</dt><dd>600</dd>
<dt>Base Attack Damage</dt><dd>57</dd>
<dt>Skills</dt><dd>Nimbus, Rain Cloud, Thunderbolt</dd>
<dt>Lore</dt><dd>I am a cloud. When I pee you call it 'rain'.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Jester</title>
</head>
<body>
<img src="./jester.png" style="width: 10vw;"/>
<h1>Detail - Jester</h1>
<dl>
<dt>Health Points</dt><dd>660</dd>
<dt>Base Attack Damage</dt><dd>64</dd>
<dt>Skills</dt><dd>Laugh, Dance, Smile</dd>
<dt>Lore</dt><dd>I do it for the LOLs.</dd>
</dl>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Detail - Sunflowey</title>
</head>
<body>
<img src="./sunflowey.png" style="width: 10vw;" />
<h1>Detail - Sunflowey</h1>
<dl>
<dt>Health Points</dt><dd>650</dd>
<dt>Base Attack Damage</dt><dd>43</dd>
<dt>Skills</dt><dd>Power Pellet, Sunshine, Pollen Punch</dd>
<dt>Lore</dt><dd>I am Sunflowey. Sometimes a sun, sometimes a flower.</dd>
</dl>
</body>
</html>
\ No newline at end of file
from django.urls import resolve
from django.test import TestCase
from django.http import HttpRequest
# Create your tests here.
class ListPageTest(TestCase):
def test_cloud_home_page_returns_correct_html(self):
response = self.client.get('/hero/cloud')
self.assertTemplateUsed(response,'detail_cloud.html')
def test_jester_home_page_returns_correct_html(self):
response = self.client.get('/hero/jester')
self.assertTemplateUsed(response,'detail_jester.html')
def test_sunflowey_home_page_returns_correct_html(self):
response = self.client.get('/hero/sunflowey')
self.assertTemplateUsed(response,'detail_sunflowey.html')
\ No newline at end of file
from django.conf.urls import url
from .views import CloudView, JesterView, SunfloweyView
urlpatterns = [
url(r'^hero/cloud$',CloudView.as_view(),name='cloud_page'),
url(r'^hero/jester$',JesterView.as_view(),name='jester_page'),
url(r'^hero/sunflowey$',SunfloweyView.as_view(),name='sunflowey_page'),
]
\ No newline at end of file
from django.shortcuts import render
from django.views.generic.base import TemplateView
home_page = None
class CloudView(TemplateView):
template_name = "detail_cloud.html"
class JesterView(TemplateView):
template_name = "detail_jester.html"
class SunfloweyView(TemplateView):
template_name = "detail_sunflowey.html"
# Create your views here.
......@@ -13,9 +13,10 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'',include('heroes.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