Mercurial > public > bravenewsurf
diff bns_website/reviews/tests.py @ 39:b9d6f6d930a9
Merged Chris and Brian's changes with mine.
author | Bob Mourlam <bob.mourlam@gmail.com> |
---|---|
date | Sun, 06 Nov 2011 20:28:25 -0600 |
parents | 5992b6b1bcd2 |
children |
line wrap: on
line diff
--- a/bns_website/reviews/tests.py Sun Nov 06 20:22:40 2011 -0600 +++ b/bns_website/reviews/tests.py Sun Nov 06 20:28:25 2011 -0600 @@ -1,16 +1,18 @@ """ -This file demonstrates writing tests using the unittest module. These will pass -when you run "manage.py test". +Reviews application view tests. -Replace this with more appropriate tests for your application. """ +from django.test import TestCase +from django.core.urlresolvers import reverse -from django.test import TestCase +class ViewTest(TestCase): -class SimpleTest(TestCase): - def test_basic_addition(self): + def test_reviews_list(self): """ - Tests that 1 + 1 always equals 2. + Tests the reviews page to ensure it displays without errors. + """ - self.assertEqual(1 + 1, 2) + response = self.client.get(reverse('reviews')) + self.assertEqual(response.status_code, 200) + self.assertTemplateUsed(response, 'reviews/review_list.html')