Skip to content

Commit

Permalink
Fix test after fixing site.
Browse files Browse the repository at this point in the history
  • Loading branch information
valberg committed Mar 30, 2022
1 parent 462d9c7 commit cff5b8b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/basic/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down

0 comments on commit cff5b8b

Please sign in to comment.