Commit 34fe90df authored by abbeeeeyyyyy's avatar abbeeeeyyyyy

Still the same error

parent 1ce0af8d
This diff is collapsed.
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class HeroesConfig(AppConfig):
name = 'heroes'
from django.db import models
# Create your models here.
{% load static %}
<!DOCTYPE html>
<html>
<head>
<title>Detail - Cloud</title>
</head>
<body>
<img src="{% static "heroes/images/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>
<button> <a href="{% url "heroes" %}"> Back to Heroes List </a> </button>
</body>
</html>
\ No newline at end of file
{% load static %}
<!DOCTYPE html>
<html>
<head>
<title>Detail - Jester</title>
</head>
<body>
<img src="{% static "heroes/images/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>
<button> <a href="{% url "heroes" %}"> Back to Heroes List </a></button>
</body>
</html>
\ No newline at end of file
{% load static %}
<!DOCTYPE html>
<html>
<head>
<title>Detail - Sunflowey</title>
</head>
<body>
<img src="{% static "heroes/images/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>
<button> <a href="{% url "heroes" %}">Back to Heroes List </a> </button>
</body>
</html>
\ No newline at end of file
{% load static %}
<html>
<head>
<title> The Will of the Wisps Wiki </title>
</head>
<body>
<h1> Will-O-Wisp Heroes </h1>
<h1 id="jester"> <a href="{% url "jester" %}" > Jester </a> </h1>
<dl>
<dt>Health Points</dt>
<dd id="hp-jester">660</dd>
<dt>Base Attack Damage</dt>
<dd id="d-jester">64</dd>
</dl>
<h1 id="cloud"> <a href="{% url "cloud" %}"> Cloud </a> </h1>
<dl>
<dt>Health Points</dt>
<dd id="hp-cloud">600</dd>
<dt>Base Attack Damage</dt>
<dd id="d-cloud">57</dd>
</dl>
<h1 id="sunflowey"><a href="{% url "sunflowey" %}"> Sunflowey </a> </h1>
<dl>
<dt>Health Points</dt>
<dd id="hp-sunflowey">650</dd>
<dt> id="d-sunflowey">Base Attack Damage</dt>
<dd>43</dd>
</dl>
</body>
</html>
\ No newline at end of file
from django.test import TestCase
from django.urls import resolve
from django.http import HttpRequest
from .views import HeroesView
from .views import JesterView
from .views import CloudView
from .views import SunfloweyView
from django.template.loader import render_to_string
# Create your tests here.
class HeroesSiteTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('/heroes/')
self.assertTemplateUsed(response, 'heroes.html')
def test_jester_page_returns_correct_html(self):
response = self.client.get('/hero/jester/')
self.assertTemplateUsed(response,'detail_jester.html')
def test_cloud_page_returns_correct_html(self):
response = self.client.get('/hero/cloud/')
self.assertTemplateUsed(response, 'detail_cloud.html')
def test_sunflowey_page_returns_correct_html(self):
response = self.client.get('/hero/sunflowey/')
self.assertTemplateUsed(response, 'detail_sunflowey.html')
from django.urls import path
from django.contrib import admin
from .views import HeroesView
from .views import JesterView
from .views import SunfloweyView
from .views import CloudView
urlpatterns = [
path('', HeroesView.as_view(), name='heroes'),
path('heroes/', HeroesView.as_view(), name='heroes'),
path('hero/jester/', JesterView.as_view(), name='jester'),
path('hero/sunflowey/', SunfloweyView.as_view(), name='sunflowey'),
path('hero/cloud/', CloudView.as_view(), name='cloud'),
]
\ No newline at end of file
from django.views.generic.base import TemplateView
from . import templates
from django.shortcuts import render
# Create your views here.
# Create your views here.
class HeroesView(TemplateView):
template_name = 'heroes.html'
class JesterView(TemplateView):
template_name = 'detail_jester.html'
class CloudView(TemplateView):
template_name = 'detail_cloud.html'
class SunfloweyView(TemplateView):
template_name = 'detail_sunflowey.html'
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