From cff5b8be6a4d026542e45b796549f913b9a9f1b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Wed, 30 Mar 2022 20:46:49 +0200 Subject: [PATCH] Fix test after fixing site. --- tests/basic/tests.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/basic/tests.py b/tests/basic/tests.py index f288f5d..57b5cd5 100644 --- a/tests/basic/tests.py +++ b/tests/basic/tests.py @@ -56,15 +56,13 @@ def test_fetch_adapter(self): def test_email_subject_prefix_settings_with_site(self): adapter = get_invitations_adapter() - with patch("invitations.adapters.Site") as MockSite: - MockSite.objects.get_current.return_value.name = "Foo.com" - result = adapter.format_email_subject("Bar") - assert result == "[Foo.com] Bar" + result = adapter.format_email_subject("Bar", context={"site_name": "Foo.com"}) + assert result == "[Foo.com] Bar" @override_settings(INVITATIONS_EMAIL_SUBJECT_PREFIX="") def test_email_subject_prefix_settings_with_custom_override(self): adapter = get_invitations_adapter() - result = adapter.format_email_subject("Bar") + result = adapter.format_email_subject("Bar", context={"site_name": "Foo.com"}) assert result == "Bar"