mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-12 18:25:35 +00:00
Validate remaining templates
This commit is contained in:
parent
ea268449fa
commit
5e9cc5eec5
1 changed files with 11 additions and 4 deletions
|
@ -39,6 +39,13 @@ class RegisterViews(TestCase):
|
||||||
id=1, require_confirm_email=False
|
id=1, require_confirm_email=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_get_redirect(self, *_):
|
||||||
|
"""there's no dedicated registration page"""
|
||||||
|
view = views.Register.as_view()
|
||||||
|
request = self.factory.get("register/")
|
||||||
|
response = view(request)
|
||||||
|
self.assertEqual(response.status_code, 302)
|
||||||
|
|
||||||
def test_register(self, *_):
|
def test_register(self, *_):
|
||||||
"""create a user"""
|
"""create a user"""
|
||||||
view = views.Register.as_view()
|
view = views.Register.as_view()
|
||||||
|
@ -112,7 +119,7 @@ class RegisterViews(TestCase):
|
||||||
)
|
)
|
||||||
response = view(request)
|
response = view(request)
|
||||||
self.assertEqual(models.User.objects.count(), 1)
|
self.assertEqual(models.User.objects.count(), 1)
|
||||||
response.render()
|
validate_html(response.render())
|
||||||
|
|
||||||
def test_register_invalid_username(self, *_):
|
def test_register_invalid_username(self, *_):
|
||||||
"""gotta have an email"""
|
"""gotta have an email"""
|
||||||
|
@ -124,7 +131,7 @@ class RegisterViews(TestCase):
|
||||||
)
|
)
|
||||||
response = view(request)
|
response = view(request)
|
||||||
self.assertEqual(models.User.objects.count(), 1)
|
self.assertEqual(models.User.objects.count(), 1)
|
||||||
response.render()
|
validate_html(response.render())
|
||||||
|
|
||||||
request = self.factory.post(
|
request = self.factory.post(
|
||||||
"register/",
|
"register/",
|
||||||
|
@ -132,7 +139,7 @@ class RegisterViews(TestCase):
|
||||||
)
|
)
|
||||||
response = view(request)
|
response = view(request)
|
||||||
self.assertEqual(models.User.objects.count(), 1)
|
self.assertEqual(models.User.objects.count(), 1)
|
||||||
response.render()
|
validate_html(response.render())
|
||||||
|
|
||||||
request = self.factory.post(
|
request = self.factory.post(
|
||||||
"register/",
|
"register/",
|
||||||
|
@ -140,7 +147,7 @@ class RegisterViews(TestCase):
|
||||||
)
|
)
|
||||||
response = view(request)
|
response = view(request)
|
||||||
self.assertEqual(models.User.objects.count(), 1)
|
self.assertEqual(models.User.objects.count(), 1)
|
||||||
response.render()
|
validate_html(response.render())
|
||||||
|
|
||||||
def test_register_closed_instance(self, *_):
|
def test_register_closed_instance(self, *_):
|
||||||
"""you can't just register"""
|
"""you can't just register"""
|
||||||
|
|
Loading…
Reference in a new issue