mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-24 09:00:33 +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
|
||||
)
|
||||
|
||||
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, *_):
|
||||
"""create a user"""
|
||||
view = views.Register.as_view()
|
||||
|
@ -112,7 +119,7 @@ class RegisterViews(TestCase):
|
|||
)
|
||||
response = view(request)
|
||||
self.assertEqual(models.User.objects.count(), 1)
|
||||
response.render()
|
||||
validate_html(response.render())
|
||||
|
||||
def test_register_invalid_username(self, *_):
|
||||
"""gotta have an email"""
|
||||
|
@ -124,7 +131,7 @@ class RegisterViews(TestCase):
|
|||
)
|
||||
response = view(request)
|
||||
self.assertEqual(models.User.objects.count(), 1)
|
||||
response.render()
|
||||
validate_html(response.render())
|
||||
|
||||
request = self.factory.post(
|
||||
"register/",
|
||||
|
@ -132,7 +139,7 @@ class RegisterViews(TestCase):
|
|||
)
|
||||
response = view(request)
|
||||
self.assertEqual(models.User.objects.count(), 1)
|
||||
response.render()
|
||||
validate_html(response.render())
|
||||
|
||||
request = self.factory.post(
|
||||
"register/",
|
||||
|
@ -140,7 +147,7 @@ class RegisterViews(TestCase):
|
|||
)
|
||||
response = view(request)
|
||||
self.assertEqual(models.User.objects.count(), 1)
|
||||
response.render()
|
||||
validate_html(response.render())
|
||||
|
||||
def test_register_closed_instance(self, *_):
|
||||
"""you can't just register"""
|
||||
|
|
Loading…
Reference in a new issue