annotate bns_website/core/tests/view_tests.py @ 3:71f2941161e9

Created a generic view (for now) to display a home page. Wrote a test for the home page. Created a test settings file that uses sqlite. Created simple 404, 500, base, and home page templates.
author Brian Neal <bgneal@gmail.com>
date Fri, 28 Oct 2011 20:32:29 -0500
parents
children 01740aa4a6b9
rev   line source
bgneal@3 1 """
bgneal@3 2 Core (non-application specific) view tests.
bgneal@3 3
bgneal@3 4 """
bgneal@3 5 from django.test import TestCase
bgneal@3 6 from django.core.urlresolvers import reverse
bgneal@3 7
bgneal@3 8
bgneal@3 9 class ViewTest(TestCase):
bgneal@3 10
bgneal@3 11 def test_home(self):
bgneal@3 12 """
bgneal@3 13 Tests the home page to ensure it displays without errors.
bgneal@3 14
bgneal@3 15 """
bgneal@3 16 response = self.client.get(reverse('home'))
bgneal@3 17 self.assertEqual(response.status_code, 200)
bgneal@3 18 self.assertTemplateUsed(response, 'home.html')