refactor tests
This commit is contained in:
parent
a2a753cac3
commit
e95656debc
1 changed files with 19 additions and 17 deletions
|
@ -2,20 +2,16 @@ from django.test import TestCase
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
|
|
||||||
|
|
||||||
class IndexTestCase(TestCase):
|
class AboutTestCase(TestCase):
|
||||||
def test_accessable(self):
|
def test_website_accessable(self):
|
||||||
response = self.client.get(reverse('pages:index'))
|
|
||||||
self.assertEqual(response.status_code, 200)
|
|
||||||
|
|
||||||
|
|
||||||
class AboutWebsiteTestCase(TestCase):
|
|
||||||
def test_accessable(self):
|
|
||||||
response = self.client.get(reverse('about:website'))
|
response = self.client.get(reverse('about:website'))
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
def test_me_accessable(self):
|
||||||
|
response = self.client.get(reverse('about:me'))
|
||||||
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
class AboutIndexTestCase(TestCase):
|
def test_index_accessable(self):
|
||||||
def test_accessable(self):
|
|
||||||
response = self.client.get(reverse('about:index'))
|
response = self.client.get(reverse('about:index'))
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
@ -33,23 +29,29 @@ class AboutIndexTestCase(TestCase):
|
||||||
self.assertContains(response, 'Already Sent')
|
self.assertContains(response, 'Already Sent')
|
||||||
|
|
||||||
|
|
||||||
class Custom404TestCase(TestCase):
|
class CorePagesTestCase(TestCase):
|
||||||
def test_accessable(self):
|
def test_404_accessable(self):
|
||||||
response = self.client.get(reverse('404'))
|
response = self.client.get(reverse('404'))
|
||||||
self.assertEqual(response.status_code, 404)
|
self.assertEqual(response.status_code, 404)
|
||||||
|
|
||||||
|
def test_no_js_accessable(self):
|
||||||
class NoJavascriptTestCase(TestCase):
|
|
||||||
def test_accessable(self):
|
|
||||||
response = self.client.get(reverse('no-js'))
|
response = self.client.get(reverse('no-js'))
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
def test_index_accessable(self):
|
||||||
|
response = self.client.get(reverse('pages:index'))
|
||||||
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
class AllProjectsTestCase(TestCase):
|
|
||||||
def test_accessable(self):
|
class ProjectsTestCase(TestCase):
|
||||||
|
def test_all_accessable(self):
|
||||||
response = self.client.get(reverse('projects:all'))
|
response = self.client.get(reverse('projects:all'))
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
def test_test_project_accessable(self):
|
||||||
|
response = self.client.get(reverse('projects:project', args=['test']))
|
||||||
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
|
||||||
class RoboticsTestCase(TestCase):
|
class RoboticsTestCase(TestCase):
|
||||||
def test_2015_index_accessable(self):
|
def test_2015_index_accessable(self):
|
||||||
|
|
Reference in a new issue