Template does not Exist error

parent 12d2f9a1
Pipeline #813 canceled with stages
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class HeroesConfig(AppConfig):
name = 'heroes'
<!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.db import models
# Create your models here.
from django.test import TestCase
from django.urls import resolve
# Create your tests here.
class ListPageTest(TestCase):
def test_cloud_page_returns_correct_html(self):
response = self.client.get('/hero/cloud')
self.assertTemplateUsed(response, 'detail_cloud.html')
def test_jester_page_returns_correct_html(self):
response = self.client.get('/hero/jester')
self.assertTemplateUsed(response, 'detail_jester.html')
def test_sunflowey_page_returns_correct_html(self):
response = self.client.get('/hero/sunflowey')
self.assertTemplateUsed(response, 'detail_sunflowey.html')
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
# Create your views here.
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