Coverage for src/couchers/constants.py: 100%

19 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-03-24 14:08 +0000

1from datetime import datetime, timedelta 

2 

3import pytz 

4 

5# terms of service version 

6TOS_VERSION = 2 

7 

8# community guidelines version 

9GUIDELINES_VERSION = 1 

10 

11EMAIL_REGEX = r"^[0-9a-z][0-9a-z\-\_\+\.]*@([0-9a-z\-]+\.)*[0-9a-z\-]+\.[a-z]{2,}$" 

12 

13# expiry time for a verified phone number 

14PHONE_VERIFICATION_LIFETIME = timedelta(days=2 * 365) 

15 

16# shortest period between phone verification code requests 

17PHONE_REVERIFICATION_INTERVAL = timedelta(days=2) 

18 

19# expiry time for an sms code 

20SMS_CODE_LIFETIME = timedelta(hours=24) 

21 

22# max attempts to enter the sms code 

23SMS_CODE_ATTEMPTS = 3 

24 

25SIGNUP_EMAIL_TOKEN_VALIDITY = timedelta(hours=48) 

26 

27DATETIME_MINUS_INFINITY = pytz.UTC.localize(datetime(1, 1, 1)) 

28DATETIME_INFINITY = pytz.UTC.localize(datetime(9876, 12, 31, hour=23, minute=59, second=59)) 

29 

30SERVER_THREADS = 128 

31 

32WORKER_THREADS = 1 

33 

34# how long the user has to undelete their account 

35UNDELETE_DAYS = 7 

36 

37# expiry time for preferrred language cookie 

38PREFERRED_LANGUAGE_COOKIE_EXPIRY = timedelta(days=3650) 

39 

40# activeness probe settings 

41# wait about 11 months before sending one out 

42ACTIVENESS_PROBE_INACTIVITY_PERIOD = timedelta(days=333) 

43# times at which to send notifications after inactivity (cumulative since start of probe) 

44ACTIVENESS_PROBE_TIME_REMINDERS = [timedelta(days=0), timedelta(days=4, hours=8)] 

45# total time from initiation after which to expire the probe 

46ACTIVENESS_PROBE_EXPIRY_TIME = timedelta(days=14)