From f870cc6243e52d7e56d1063e2af8a265404d78f9 Mon Sep 17 00:00:00 2001 From: Ed Summers Date: Mon, 17 Oct 2011 18:37:31 +0000 Subject: [PATCH] added regression test for non-logged in user viewing the supporter page --- frontend/tests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/tests.py b/frontend/tests.py index 74a833a4..cf7b25b6 100755 --- a/frontend/tests.py +++ b/frontend/tests.py @@ -20,3 +20,19 @@ class WishlistTests(TestCase): r = self.client.post("/wishlist/", {"remove_work_id": "1"}, HTTP_X_REQUESTED_WITH="XMLHttpRequest") self.assertEqual(self.user.wishlist.works.all().count(), 0) + +class SupporterPage(TestCase): + + def setUp(self): + self.user = User.objects.create_user('test', 'test@example.org', 'test') + self.client = Client() + self.client.login(username='test', password='test') + + def test_view_by_anonymous(self): + # logged in + r = self.client.get("/supporter/test/") + self.assertEqual(r.status_code, 200) + # not logged in + anon_client = Client() + r = self.client.get("/supporter/test/") + self.assertEqual(r.status_code, 200)