1
Fork 0

Added test case for common view component

This commit is contained in:
Jake Howard 2016-01-10 21:23:55 +00:00
parent 881bc20749
commit 05e738e6a9

16
project/common/tests.py Normal file
View file

@ -0,0 +1,16 @@
from django.test import TestCase
from django.core.urlresolvers import reverse
class CustomTemplateTestCase(TestCase):
def setUp(self):
self.template = 'pages:index'
def test_accessable(self):
response = self.client.get(reverse(self.template))
self.assertEqual(response.status_code, 200)
def test_context(self):
response = self.client.get(reverse(self.template))
for item in ['html_title', 'body_class', 'js_redirect']:
self.assertIn(item, response.context)