Updates tests

This commit is contained in:
Mouse Reeve 2022-03-19 15:16:20 -07:00
parent 78ac252dae
commit 1b53c81351
2 changed files with 10 additions and 3 deletions

View file

@ -6,5 +6,5 @@
{% endblock %}
{% 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 %}

View file

@ -360,10 +360,17 @@ class RegisterViews(TestCase):
result = view(request)
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"""
request = self.factory.post("", {"email": "mouse@mouse.com"})
request.user = self.anonymous_user
with patch("bookwyrm.emailing.send_email.delay") as mock:
views.resend_link(request)
views.ResendConfirmEmail.as_view()(request)
self.assertEqual(mock.call_count, 1)