diff --git a/project/pages/tests.py b/project/pages/tests.py index 94dccfe..36ef458 100644 --- a/project/pages/tests.py +++ b/project/pages/tests.py @@ -1,5 +1,7 @@ from django.test import TestCase from django.core.urlresolvers import reverse +from django.conf import settings +import os.path, json class AboutTestCase(TestCase): @@ -42,6 +44,14 @@ class CorePagesTestCase(TestCase): response = self.client.get(reverse('pages:index')) self.assertEqual(response.status_code, 200) + def test_index_projects(self): + projects = json.load(open(os.path.join(settings.BASE_DIR, 'data/projects.json'))) + response = self.client.get(reverse('pages:index')) + for key, project in projects.items(): + self.assertContains(response, project['title']) + if 'image' in project: + self.assertContains(response, project['image']) + class ProjectsTestCase(TestCase): def test_all_accessable(self):