Coverage for src/expo_notifications/conf.py: 100%

1 from datetime import timedelta

2

3 from django.conf import settings as django_settings

4

5

6 class Settings:

7 @property

8 def token(self) -> str | None:

9 return getattr(

10 django_settings,

11 "EXPO_NOTIFICATIONS_TOKEN",

12 None,

13 )

14

15 @property

16 def receipt_check_delay(self) -> timedelta:

17 return getattr(

18 django_settings,

19 "EXPO_NOTIFICATIONS_RECEIPT_CHECK_DELAY",

20 timedelta(minutes=30),

21 )

22

23 @property

24 def sending_task_max_retries(self) -> int:

25 return getattr(

26 django_settings,

27 "EXPO_NOTIFICATIONS_SENDING_TASK_MAX_RETRIES",

28 5,

29 )

30

31 @property

32 def sending_task_retry_delay(self) -> timedelta:

33 return getattr(

34 django_settings,

35 "EXPO_NOTIFICATIONS_SENDING_TASK_RETRY_DELAY",

36 timedelta(seconds=30),

37 )

38

39 @property

40 def checking_task_max_retries(self) -> int:

41 return getattr(

42 django_settings,

43 "EXPO_NOTIFICATIONS_CHECKING_TASK_MAX_RETRIES",

44 3,

45 )

46

47 @property

48 def checking_task_retry_delay(self) -> timedelta:

49 return getattr(

50 django_settings,

51 "EXPO_NOTIFICATIONS_CHECKING_TASK_RETRY_DELAY",

52 timedelta(minutes=1),

53 )

54

55

56 settings = Settings()