Commit 99031989 authored by Alec Wang's avatar Alec Wang

added more unit tests

parent 1c568094
Pipeline #905 canceled with stages
...@@ -5,7 +5,33 @@ from django.test import TestCase ...@@ -5,7 +5,33 @@ from django.test import TestCase
from .views import * from .views import *
from django.test import TestCase
class HomePageTest(TestCase): class HomePageTest(TestCase):
def test_uses_heroes_template(self):
def test_home_page_returns_correct_html(self):
response = self.client.get('/') response = self.client.get('/')
self.assertTemplateUser(response, 'heroes.html') self.assertTemplateUsed(response, 'heroes.html')
class HeroesPageTest(TestCase):
def test_heroes_page(self):
response = self.client.get('/heroes')
self.assertTemplateUsed(response, 'heroes.html')
class HeroPagesTest(TestCase):
def test_cloud_page(self):
response = self.client.get('/hero/cloud')
self.assertTemplateUsed(response, 'detail_cloud.html')
def test_jester_page(self):
response = self.client.get('/hero/jester')
self.assertTemplateUsed(response, 'detail_jester.html')
def test_cloud_page(self):
response = self.client.get('/hero/sunflowey')
self.assertTemplateUsed(response, '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