comparison bns_website/reviews/tests.py @ 34:37d9b6b1a097

Added reviews template tag. Fix ordering of reviews. Tweaked the display of the reviews page. Addresses ticket 2.
author Chris Ridgway <ckridgway@gmail.com>
date Sat, 05 Nov 2011 23:53:10 -0500
parents 71f2beb03789
children 5992b6b1bcd2
comparison
equal deleted inserted replaced
33:b5329e6ad828 34:37d9b6b1a097
1 """ 1 """
2 This file demonstrates writing tests using the unittest module. These will pass 2 Reviews application view tests.
3 when you run "manage.py test".
4 3
5 Replace this with more appropriate tests for your application.
6 """ 4 """
7
8 from django.test import TestCase 5 from django.test import TestCase
6 from django.core.urlresolvers import reverse
9 7
10 8
11 class SimpleTest(TestCase): 9 class ViewTest(TestCase):
12 def test_basic_addition(self): 10
11 def test_home(self):
13 """ 12 """
14 Tests that 1 + 1 always equals 2. 13 Tests the home page to ensure it displays without errors.
14
15 """ 15 """
16 self.assertEqual(1 + 1, 2) 16 response = self.client.get(reverse('reviews'))
17 self.assertEqual(response.status_code, 200)
18 self.assertTemplateUsed(response, 'reviews/review_list.html')