Permalink
Browse files

Added basic integrity test for multi-blog model

  • Loading branch information...
1 parent e7457ad commit aaccd369c95f2e76b4fe618263362f3891cb5a88 @dduan committed Aug 12, 2010
Showing with 41 additions and 3 deletions.
  1. +3 −3 runtests.py
  2. +1 −0 sophie/tests/__init__.py
  3. +37 −0 sophie/tests/integrity.py
View
@@ -3,7 +3,6 @@
from django.conf import settings
if not settings.configured:
- print 'configuring settings'
settings.configure(
DATABASE_ENGINE = 'sqlite3',
TEMPLATE_LOADERS = (
@@ -22,7 +21,8 @@
'sophie',
),
ROOT_URLCONF = 'sophie.tests.base_urls',
-
+ SOPHIE_ENABLES_MULTIBLOG = True,
+ SITE_ID = 1,
)
from os.path import dirname, abspath
@@ -35,7 +35,7 @@ def runtests(*test_args):
test_args = ['sophie']
parent = dirname(abspath(__file__))
sys.path.insert(0, parent)
- failures = run_tests(test_args)
+ failures = run_tests(test_args, verbosity=1)
sys.exit(failures)
if __name__ == '__main__':
View
@@ -0,0 +1 @@
+from integrity import *
View
@@ -0,0 +1,37 @@
+from django.test import TestCase
+
+class MultiBlogIntegrityTest(TestCase):
+
+ fixtures = ['integrity']
+
+ def test_home_page_behaves_well(self):
+ response = self.client.get('/')
+ self.assertEquals(response.status_code, 200)
+
+ def test_blog_index_behaves_well(self):
+ response = self.client.get('/blog-2/')
+ self.assertEquals(response.status_code, 200)
+
+ def test_entry_list_behaves_well(self):
+ response = self.client.get('/blog-1/entries/1/')
+ self.assertEquals(response.status_code, 200)
+
+ def test_entry_details_behaves_well(self):
+ response = self.client.get('/blog-1/entry/essay-1/')
+ self.assertEquals(response.status_code, 200)
+
+ def test_category_details_behaves_well(self):
+ response = self.client.get('/blog-1/category/category-1/')
+ self.assertEquals(response.status_code, 200)
+
+ def test_original_feed_behaves_well(self):
+ response = self.client.get('/blog-2/feed/')
+ self.assertEquals(response.status_code, 200)
+
+ def test_root_sitemap_behaves_well(self):
+ response = self.client.get('/sitemap.xml')
+ self.assertEquals(response.status_code, 200)
+
+ def test_blog_sitemap_behaves_well(self):
+ response = self.client.get('/blog-2/sitemap.xml')
+ self.assertEquals(response.status_code, 200)

0 comments on commit aaccd36

Please sign in to comment.