comparison bns_website/news/tests.py @ 42:66a3cafc4548

I added a basic news test.
author Bob Mourlam <bob.mourlam@gmail.com>
date Mon, 07 Nov 2011 21:20:29 -0600
parents 2de51cc51d3a
children
comparison
equal deleted inserted replaced
41:9ce9f77d6cde 42:66a3cafc4548
1 """ 1 """
2 This file demonstrates writing tests using the unittest module. These will pass 2 News Tests
3 when you run "manage.py test".
4
5 Replace this with more appropriate tests for your application.
6 """ 3 """
7 4
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 SimpleTest(TestCase):
12 def test_basic_addition(self): 10 def test_news_list(self):
13 """ 11 response = self.client.get(reverse('news'))
14 Tests that 1 + 1 always equals 2. 12 self.assertEqual(response.status_code, 200)
15 """ 13 self.assertTemplateUsed(response, 'news/news_list.html')
16 self.assertEqual(1 + 1, 2)