From 4ad81789bede8abe3902cc196f4d7e43ad98286a Mon Sep 17 00:00:00 2001 From: CLAIRE GATENBY Date: Thu, 16 Feb 2017 20:19:24 -0800 Subject: [PATCH] added test for about page route --- neuropy/userprofile/tests.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/neuropy/userprofile/tests.py b/neuropy/userprofile/tests.py index 5d03c53..c396f8b 100644 --- a/neuropy/userprofile/tests.py +++ b/neuropy/userprofile/tests.py @@ -1,7 +1,7 @@ """Tests for the userprofile app.""" from django.test import TestCase, Client, RequestFactory -from django.contrib.auth.models import User, Group, Permission +from django.contrib.auth.models import User, Group from userprofile.models import Profile, CredentialsModel import factory from django.core.urlresolvers import reverse_lazy @@ -120,6 +120,23 @@ def test_home_route_templates(self): self.assertTemplateUsed(response, "neuropy/base.html") self.assertTemplateUsed(response, "neuropy/home.html") + def test_home_route_status(self): + """Test home route status is 200.""" + response = self.client.get(reverse_lazy('home')) + self.assertTrue(response.status_code == 200) + + def test_about_route_status(self): + """Test about route status is 200.""" + response = self.client.get(reverse_lazy('about')) + self.assertTrue(response.status_code == 200) + + def test_about_route_templates(self): + """Test about route templates are correct.""" + response = self.client.get(reverse_lazy('about')) + self.assertTemplateUsed(response, "neuropy/base.html") + self.assertTemplateUsed(response, "neuropy/layout.html") + self.assertTemplateUsed(response, "neuropy/about.html") + def test_login_redirect_code(self): """Test built-in login route redirects properly.""" add_user_group()