Skip to content
Snippets Groups Projects
Commit b902c13e authored by Saurabh Kumar's avatar Saurabh Kumar Committed by Fredrik Jonsson
Browse files

Use wagtail 3.0.1 and use robust testing for the activation email

parent 3f1f0966
No related branches found
No related tags found
No related merge requests found
from django.core import mail from django.core import mail
from test.support import EnvironmentVarGuard
from django.test import TestCase, override_settings from django.test import TestCase, override_settings
from django.conf import settings
from hypha.apply.users.tests.factories import UserFactory from hypha.apply.users.tests.factories import UserFactory
...@@ -9,7 +9,12 @@ from ..utils import send_activation_email ...@@ -9,7 +9,12 @@ from ..utils import send_activation_email
@override_settings(ROOT_URLCONF='hypha.apply.urls') @override_settings(ROOT_URLCONF='hypha.apply.urls')
class TestActivationEmail(TestCase): class TestActivationEmail(TestCase):
def setUp(self) -> None:
self.env = EnvironmentVarGuard()
self.env.set('PRIMARY_HOST', 'primary-domain.org')
def test_activation_email_includes_link(self): def test_activation_email_includes_link(self):
send_activation_email(UserFactory()) with self.env:
self.assertEqual(len(mail.outbox), 1) send_activation_email(UserFactory())
self.assertContains(mail.outbox[0], settings.WAGTAILADMIN_BASE_URL) assert len(mail.outbox) == 1
assert "password reset form at https://primary-domain.org" in mail.outbox[0]
...@@ -48,6 +48,6 @@ social_auth_app_django==5.0.0 ...@@ -48,6 +48,6 @@ social_auth_app_django==5.0.0
tomd==0.1.3 tomd==0.1.3
wagtail-cache==1.0.2 wagtail-cache==1.0.2
wagtail-purge==0.1 wagtail-purge==0.1
wagtail==3.0.0 wagtail==3.0.1
whitenoise==5.3.0 whitenoise==5.3.0
xmltodict==0.12.0 xmltodict==0.12.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment