Commit 3c87236b authored by Jay Lopez's avatar Jay Lopez

added basic unit tests for proper template checks

parent 290baf42
from django.test import TestCase
class HomePageTest(TestCase):
def test_uses_homepage_template(self):
response = self.client.get('/heroes')
self.assertTemplateUsed(response, 'index.html')
class DetailPageTest(TestCase):
hero_names = ['cloud', 'jester', 'sunflowey']
def test_uses_specific_detail_template(self):
for name in DetailPageTest.hero_names:
response = self.client.get('/hero/' + name)
self.assertTemplateUsed(response, 'detail_' + name + '.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