forked from mirrors/bookwyrm
Updates tests
This commit is contained in:
parent
78ac252dae
commit
1b53c81351
2 changed files with 10 additions and 3 deletions
|
@ -6,5 +6,5 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% include "confirm_email/resend_modal.html" with active=True static=True %}
|
{% include "confirm_email/resend_modal.html" with active=True static=True id="resend-modal" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -360,10 +360,17 @@ class RegisterViews(TestCase):
|
||||||
result = view(request)
|
result = view(request)
|
||||||
validate_html(result.render())
|
validate_html(result.render())
|
||||||
|
|
||||||
def test_resend_link(self, *_):
|
def test_resend_link_get(self, *_):
|
||||||
|
"""try again"""
|
||||||
|
request = self.factory.get("")
|
||||||
|
request.user = self.anonymous_user
|
||||||
|
result = views.ResendConfirmEmail.as_view()(request)
|
||||||
|
validate_html(result.render())
|
||||||
|
|
||||||
|
def test_resend_link_post(self, *_):
|
||||||
"""try again"""
|
"""try again"""
|
||||||
request = self.factory.post("", {"email": "mouse@mouse.com"})
|
request = self.factory.post("", {"email": "mouse@mouse.com"})
|
||||||
request.user = self.anonymous_user
|
request.user = self.anonymous_user
|
||||||
with patch("bookwyrm.emailing.send_email.delay") as mock:
|
with patch("bookwyrm.emailing.send_email.delay") as mock:
|
||||||
views.resend_link(request)
|
views.ResendConfirmEmail.as_view()(request)
|
||||||
self.assertEqual(mock.call_count, 1)
|
self.assertEqual(mock.call_count, 1)
|
||||||
|
|
Loading…
Reference in a new issue