2016-01-10 16:12:58 +00:00
|
|
|
from django.test import TestCase
|
|
|
|
from django.core.urlresolvers import reverse
|
|
|
|
|
|
|
|
|
|
|
|
class IndexTestCase(TestCase):
|
|
|
|
def test_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('pages:about-website'))
|
|
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
|
|
|
|
|
|
|
|
class AboutIndexTestCase(TestCase):
|
|
|
|
def test_accessable(self):
|
|
|
|
response = self.client.get(reverse('pages:about'))
|
|
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
|
2016-01-24 19:54:57 +00:00
|
|
|
def test_email_send(self):
|
|
|
|
data = {
|
|
|
|
'email': '123@123.123',
|
|
|
|
'name': 'Person',
|
|
|
|
'message': 'Hi there, things.'
|
|
|
|
}
|
|
|
|
response = self.client.post(reverse('pages:about'), data)
|
|
|
|
self.assertRedirects(response, '/about/?sent')
|
|
|
|
|
2016-01-10 16:12:58 +00:00
|
|
|
|
|
|
|
class Custom404TestCase(TestCase):
|
|
|
|
def test_accessable(self):
|
|
|
|
response = self.client.get(reverse('404'))
|
|
|
|
self.assertEqual(response.status_code, 404)
|
|
|
|
|
|
|
|
|
|
|
|
class NoJavascriptTestCase(TestCase):
|
|
|
|
def test_accessable(self):
|
|
|
|
response = self.client.get(reverse('no-js'))
|
|
|
|
self.assertEqual(response.status_code, 200)
|
2016-01-21 07:51:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
class AllProjectsTestCase(TestCase):
|
|
|
|
def test_accessable(self):
|
|
|
|
response = self.client.get(reverse('pages:all-projects'))
|
|
|
|
self.assertEqual(response.status_code, 200)
|