-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5317 from akvo/send-link-report-in-email
Send report error email only when maxxed attempts
- Loading branch information
Showing
2 changed files
with
10 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
import binascii | ||
from datetime import timedelta | ||
from typing import cast | ||
from django.conf import settings | ||
from django.core import mail | ||
from django.core.files.storage import Storage, default_storage | ||
from django.test import override_settings | ||
|
@@ -49,6 +50,7 @@ def test_cleanup_expired_reports_deletes_file(self): | |
class NotifyErrorTestCase(BaseTestCase): | ||
def setUp(self): | ||
super().setUp() | ||
max_attempts = getattr(settings, 'Q_CLUSTER', {}).get('max_attempts', 1) | ||
self.create_user('[email protected]') | ||
self.failed_task = Task.objects.create( | ||
id=self._generate_id(), | ||
|
@@ -57,7 +59,8 @@ def setUp(self): | |
result='error', | ||
success=False, | ||
started=timezone.now(), | ||
stopped=timezone.now() | ||
stopped=timezone.now(), | ||
attempt_count=max_attempts | ||
) | ||
self.success_task = Task.objects.create( | ||
id=self._generate_id(), | ||
|
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