-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove constraint on resend_frequency_days
1 parent
6e6d5e1
commit 1fd0bc9
Showing
5 changed files
with
13 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,10 +71,9 @@ def test_can_send_same_campaign_twice_with_resend_frequency(self) -> None: | |
with override_instance_config("EMAIL_HOST", "localhost"): | ||
sent_at = timezone.now() - timezone.timedelta(days=8) | ||
|
||
record, _ = MessagingRecord.objects.get_or_create( | ||
raw_email="[email protected]", campaign_key="campaign_2", resend_frequency_days=7 | ||
) | ||
record, _ = MessagingRecord.objects.get_or_create(raw_email="[email protected]", campaign_key="campaign_2") | ||
record.sent_at = sent_at | ||
record.resend_frequency_days = 7 | ||
record.save() | ||
|
||
assert record.resend_frequency_days == 7 | ||
|
@@ -103,10 +102,9 @@ def test_can_send_same_campaign_thrice_with_resend_frequency(self) -> None: | |
with override_instance_config("EMAIL_HOST", "localhost"): | ||
sent_at = timezone.now() - timezone.timedelta(days=20) | ||
|
||
record, _ = MessagingRecord.objects.get_or_create( | ||
raw_email="[email protected]", campaign_key="campaign_2", resend_frequency_days=7 | ||
) | ||
record, _ = MessagingRecord.objects.get_or_create(raw_email="[email protected]", campaign_key="campaign_2") | ||
record.sent_at = sent_at | ||
record.resend_frequency_days = 7 | ||
record.resend_dates = [timezone.now().timestamp() - 10 * 24 * 60 * 60] | ||
record.save() | ||
|
||
|
@@ -130,10 +128,9 @@ def test_cant_send_same_campaign_twice_less_than_resend_frequency(self) -> None: | |
with override_instance_config("EMAIL_HOST", "localhost"): | ||
sent_at = timezone.now() - timezone.timedelta(days=6) | ||
|
||
record, _ = MessagingRecord.objects.get_or_create( | ||
raw_email="[email protected]", campaign_key="campaign_2", resend_frequency_days=7 | ||
) | ||
record, _ = MessagingRecord.objects.get_or_create(raw_email="[email protected]", campaign_key="campaign_2") | ||
record.sent_at = sent_at | ||
record.resend_frequency_days = 7 | ||
record.save() | ||
|
||
assert record.resend_frequency_days == 7 | ||
|