Commit 1f17688c authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Account page should only be accessed when logged in

parent d8b38911
...@@ -16,6 +16,15 @@ class AboutPageTests(TestCase): ...@@ -16,6 +16,15 @@ class AboutPageTests(TestCase):
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
class AccountPageTests(TestCase):
def test_works(self):
response = self.client.get(reverse('basetheme_bootstrap:account'))
self.assertRedirects(
response,
expected_url=reverse('basetheme_bootstrap:login') + "?next=" + reverse('basetheme_bootstrap:account'),
)
class SignUpTests(TestCase): class SignUpTests(TestCase):
def setUp(self): def setUp(self):
......
...@@ -134,6 +134,7 @@ def user_delete(request): ...@@ -134,6 +134,7 @@ def user_delete(request):
}) })
@login_required
def account_detail(request): def account_detail(request):
klass = user_preferences.get_user_preference_class() klass = user_preferences.get_user_preference_class()
if klass is None: if klass is None:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment