-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 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
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 |
---|---|---|
|
@@ -54,6 +54,7 @@ def setUp(self): | |
first_name="John", | ||
last_name="Frusciante", | ||
email="[email protected]", | ||
notification_delay_days=365, # 1 year, the default value | ||
) | ||
|
||
# comment_author has also an alert that match second_obs | ||
|
@@ -210,6 +211,21 @@ def test_mark_as_unseen_by_failure_3(self): | |
observation=self.obs, user=self.comment_author | ||
) | ||
|
||
def test_date_older_than_user_delay(self): | ||
"""The method works as expected""" | ||
yesterday = datetime.date.today() - datetime.timedelta(days=1) | ||
|
||
self.assertFalse( | ||
self.obs.date_older_than_user_delay(self.comment_author, the_date=yesterday) | ||
) | ||
|
||
two_years_ago = datetime.date.today() - datetime.timedelta(days=365 * 2) | ||
self.assertTrue( | ||
self.obs.date_older_than_user_delay( | ||
self.comment_author, the_date=two_years_ago | ||
) | ||
) | ||
|
||
def test_replace_observation(self): | ||
"""High-level test: after creating a new observation with the same stable_id, make sure we can migrate the | ||
linked entities then and then delete the initial observation""" | ||
|