forked from mirrors/bookwyrm
Updates mocks for new view locations
This commit is contained in:
parent
d735d03b59
commit
5b22cf8c46
3 changed files with 11 additions and 11 deletions
|
@ -58,7 +58,7 @@ class LoginViews(TestCase):
|
||||||
request = self.factory.post("", form.data)
|
request = self.factory.post("", form.data)
|
||||||
request.user = self.anonymous_user
|
request.user = self.anonymous_user
|
||||||
|
|
||||||
with patch("bookwyrm.views.login.login"):
|
with patch("bookwyrm.views.landing.login.login"):
|
||||||
result = view(request)
|
result = view(request)
|
||||||
self.assertEqual(result.url, "/")
|
self.assertEqual(result.url, "/")
|
||||||
self.assertEqual(result.status_code, 302)
|
self.assertEqual(result.status_code, 302)
|
||||||
|
@ -72,7 +72,7 @@ class LoginViews(TestCase):
|
||||||
request = self.factory.post("", form.data)
|
request = self.factory.post("", form.data)
|
||||||
request.user = self.anonymous_user
|
request.user = self.anonymous_user
|
||||||
|
|
||||||
with patch("bookwyrm.views.login.login"):
|
with patch("bookwyrm.views.landing.login.login"):
|
||||||
result = view(request)
|
result = view(request)
|
||||||
self.assertEqual(result.url, "/")
|
self.assertEqual(result.url, "/")
|
||||||
self.assertEqual(result.status_code, 302)
|
self.assertEqual(result.status_code, 302)
|
||||||
|
@ -86,7 +86,7 @@ class LoginViews(TestCase):
|
||||||
request = self.factory.post("", form.data)
|
request = self.factory.post("", form.data)
|
||||||
request.user = self.anonymous_user
|
request.user = self.anonymous_user
|
||||||
|
|
||||||
with patch("bookwyrm.views.login.login"):
|
with patch("bookwyrm.views.landing.login.login"):
|
||||||
result = view(request)
|
result = view(request)
|
||||||
self.assertEqual(result.url, "/")
|
self.assertEqual(result.url, "/")
|
||||||
self.assertEqual(result.status_code, 302)
|
self.assertEqual(result.status_code, 302)
|
||||||
|
@ -100,7 +100,7 @@ class LoginViews(TestCase):
|
||||||
request = self.factory.post("", form.data)
|
request = self.factory.post("", form.data)
|
||||||
request.user = self.anonymous_user
|
request.user = self.anonymous_user
|
||||||
|
|
||||||
with patch("bookwyrm.views.login.login"):
|
with patch("bookwyrm.views.landing.login.login"):
|
||||||
result = view(request)
|
result = view(request)
|
||||||
result.render()
|
result.render()
|
||||||
self.assertEqual(result.status_code, 200)
|
self.assertEqual(result.status_code, 200)
|
||||||
|
|
|
@ -105,7 +105,7 @@ class PasswordViews(TestCase):
|
||||||
view = views.PasswordReset.as_view()
|
view = views.PasswordReset.as_view()
|
||||||
code = models.PasswordReset.objects.create(user=self.local_user)
|
code = models.PasswordReset.objects.create(user=self.local_user)
|
||||||
request = self.factory.post("", {"password": "hi", "confirm-password": "hi"})
|
request = self.factory.post("", {"password": "hi", "confirm-password": "hi"})
|
||||||
with patch("bookwyrm.views.password.login"):
|
with patch("bookwyrm.views.landing.password.login"):
|
||||||
resp = view(request, code.code)
|
resp = view(request, code.code)
|
||||||
self.assertEqual(resp.status_code, 302)
|
self.assertEqual(resp.status_code, 302)
|
||||||
self.assertFalse(models.PasswordReset.objects.exists())
|
self.assertFalse(models.PasswordReset.objects.exists())
|
||||||
|
|
|
@ -58,7 +58,7 @@ class RegisterViews(TestCase):
|
||||||
"email": "aa@bb.cccc",
|
"email": "aa@bb.cccc",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
with patch("bookwyrm.views.register.login"):
|
with patch("bookwyrm.views.landing.register.login"):
|
||||||
response = view(request)
|
response = view(request)
|
||||||
self.assertEqual(models.User.objects.count(), 2)
|
self.assertEqual(models.User.objects.count(), 2)
|
||||||
self.assertEqual(response.status_code, 302)
|
self.assertEqual(response.status_code, 302)
|
||||||
|
@ -83,7 +83,7 @@ class RegisterViews(TestCase):
|
||||||
"email": "aa@bb.cccc",
|
"email": "aa@bb.cccc",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
with patch("bookwyrm.views.register.login"):
|
with patch("bookwyrm.views.landing.register.login"):
|
||||||
response = view(request)
|
response = view(request)
|
||||||
self.assertEqual(response.status_code, 302)
|
self.assertEqual(response.status_code, 302)
|
||||||
nutria = models.User.objects.get(localname="nutria")
|
nutria = models.User.objects.get(localname="nutria")
|
||||||
|
@ -101,7 +101,7 @@ class RegisterViews(TestCase):
|
||||||
"register/",
|
"register/",
|
||||||
{"localname": "nutria ", "password": "mouseword", "email": "aa@bb.ccc"},
|
{"localname": "nutria ", "password": "mouseword", "email": "aa@bb.ccc"},
|
||||||
)
|
)
|
||||||
with patch("bookwyrm.views.register.login"):
|
with patch("bookwyrm.views.landing.register.login"):
|
||||||
response = view(request)
|
response = view(request)
|
||||||
self.assertEqual(models.User.objects.count(), 2)
|
self.assertEqual(models.User.objects.count(), 2)
|
||||||
self.assertEqual(response.status_code, 302)
|
self.assertEqual(response.status_code, 302)
|
||||||
|
@ -140,7 +140,7 @@ class RegisterViews(TestCase):
|
||||||
"invite_code": "testcode",
|
"invite_code": "testcode",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
with patch("bookwyrm.views.register.login"):
|
with patch("bookwyrm.views.landing.register.login"):
|
||||||
response = view(request)
|
response = view(request)
|
||||||
response = view(request)
|
response = view(request)
|
||||||
validate_html(response.render())
|
validate_html(response.render())
|
||||||
|
@ -216,7 +216,7 @@ class RegisterViews(TestCase):
|
||||||
"register/",
|
"register/",
|
||||||
{"localname": "nutria ", "password": "mouseword", "email": "aa@bleep.com"},
|
{"localname": "nutria ", "password": "mouseword", "email": "aa@bleep.com"},
|
||||||
)
|
)
|
||||||
with patch("bookwyrm.views.register.login"):
|
with patch("bookwyrm.views.landing.register.login"):
|
||||||
result = view(request)
|
result = view(request)
|
||||||
self.assertEqual(result.status_code, 302)
|
self.assertEqual(result.status_code, 302)
|
||||||
self.assertTrue(models.User.objects.filter(email="aa@bleep.com").exists())
|
self.assertTrue(models.User.objects.filter(email="aa@bleep.com").exists())
|
||||||
|
@ -240,7 +240,7 @@ class RegisterViews(TestCase):
|
||||||
"invite_code": "testcode",
|
"invite_code": "testcode",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
with patch("bookwyrm.views.register.login"):
|
with patch("bookwyrm.views.landing.register.login"):
|
||||||
response = view(request)
|
response = view(request)
|
||||||
self.assertEqual(models.User.objects.count(), 2)
|
self.assertEqual(models.User.objects.count(), 2)
|
||||||
self.assertEqual(response.status_code, 302)
|
self.assertEqual(response.status_code, 302)
|
||||||
|
|
Loading…
Reference in a new issue