mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-29 19:40:32 +00:00
Adds another register test
This commit is contained in:
parent
7ec573bf50
commit
3118cdfbb6
1 changed files with 12 additions and 0 deletions
|
@ -121,6 +121,18 @@ class RegisterViews(TestCase):
|
|||
self.assertEqual(models.User.objects.count(), 1)
|
||||
validate_html(response.render())
|
||||
|
||||
def test_register_username_in_use(self, *_):
|
||||
"""that username is taken"""
|
||||
view = views.Register.as_view()
|
||||
self.assertEqual(models.User.objects.count(), 1)
|
||||
request = self.factory.post(
|
||||
"register/",
|
||||
{"localname": "mouse", "password": "mouseword", "email": "aa@bb.ccc"},
|
||||
)
|
||||
response = view(request)
|
||||
self.assertEqual(models.User.objects.count(), 1)
|
||||
validate_html(response.render())
|
||||
|
||||
def test_register_invalid_username(self, *_):
|
||||
"""gotta have an email"""
|
||||
view = views.Register.as_view()
|
||||
|
|
Loading…
Reference in a new issue