-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ [open-zaak/open-zaak#1203] Tests for notif retry setup config
- Loading branch information
Showing
2 changed files
with
37 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
31 changes: 31 additions & 0 deletions
31
src/nrc/tests/config/test_notification_retry_configuration.py
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from django.test import TestCase, override_settings | ||
|
||
from notifications_api_common.models import NotificationsConfig | ||
|
||
from nrc.config.notification_retry import NotificationRetryConfigurationStep | ||
|
||
|
||
@override_settings( | ||
NOTIFICATION_DELIVERY_MAX_RETRIES=4, | ||
NOTIFICATION_DELIVERY_RETRY_BACKOFF=5, | ||
NOTIFICATION_DELIVERY_RETRY_BACKOFF_MAX=6, | ||
) | ||
class NotificationRetryConfigurationTests(TestCase): | ||
def test_configure(self): | ||
configuration = NotificationRetryConfigurationStep() | ||
configuration.configure() | ||
|
||
config = NotificationsConfig.get_solo() | ||
|
||
self.assertEqual(config.notification_delivery_max_retries, 4) | ||
self.assertEqual(config.notification_delivery_retry_backoff, 5) | ||
self.assertEqual(config.notification_delivery_retry_backoff_max, 6) | ||
|
||
def test_is_configured(self): | ||
configuration = NotificationRetryConfigurationStep() | ||
|
||
self.assertFalse(configuration.is_configured()) | ||
|
||
configuration.configure() | ||
|
||
self.assertTrue(configuration.is_configured()) |