Skip to content

Commit 8a39e48

Browse files
committed
[fix:tests] Fixed expiration mail flaky tests #375
Closes #375
1 parent 1a6bb59 commit 8a39e48

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

openwisp_users/tests/test_models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,10 @@ def test_has_password_expired(self):
393393
@patch.object(app_settings, 'USER_PASSWORD_EXPIRATION', 30)
394394
@patch.object(app_settings, 'STAFF_USER_PASSWORD_EXPIRATION', 90)
395395
def test_password_expiration_mail(self):
396-
user_expiry_date = now().today() - timedelta(
396+
user_expiry_date = now().date() - timedelta(
397397
days=(app_settings.USER_PASSWORD_EXPIRATION - 7)
398398
)
399-
staff_user_expiry_date = now().today() - timedelta(
399+
staff_user_expiry_date = now().date() - timedelta(
400400
days=(app_settings.STAFF_USER_PASSWORD_EXPIRATION - 7)
401401
)
402402
staff_user = self._create_operator()
@@ -459,7 +459,7 @@ def test_password_expiration_mail(self):
459459
@patch.object(app_settings, 'USER_PASSWORD_EXPIRATION', 30)
460460
@patch('openwisp_users.tasks.sleep')
461461
def test_password_expiration_mail_sleep(self, mocked_sleep):
462-
user_expiry_date = now().today() - timedelta(
462+
user_expiry_date = now().date() - timedelta(
463463
days=(app_settings.USER_PASSWORD_EXPIRATION - 7)
464464
)
465465
for i in range(10):

0 commit comments

Comments
 (0)