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

15 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-11-21 04:21 +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