Started on heroes unit test and added URLs.

parent 8fb1fd91
<!DOCTYPE html>
<html>
<head>
<title>The Will of the Wisps Wiki</title>
</head>
</html>
\ No newline at end of file
from django.urls import resolve
from django.test import TestCase
# Create your tests here.
class HomePageTest(TestCase):
def test_heroes_page_returns_correct_html(self):
response = self.client.get('/')
html = response.content.decode('utf8')
self.assertTemplateUsed(response, 'heroes.html')
from django.conf.urls import url
from .views import heroes_page
urlpatterns = [
url(r'^heroes/$', heroes_page, name='heroes_page'),
url(r'^hero/cloud$', cloud_page, name='cloud_page'),
url(r'^hero/sunflowey$', sunflowey_page, name='sunflowey_page'),
url(r'^hero/jester$', jester_page, name='jester_page'),
]
from django.shortcuts import render
# Create your views here.
def heroes_page(request):
return render(request, 'heroes.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