Skip to content

Commit 6ae6029

Browse files
committed
[1.11.x] Updated was_published_recently() tutorial test to check boundary condition.
Backport of 268a646 from master
1 parent 8f7e6b5 commit 6ae6029

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/intro/tutorial05.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ more comprehensively:
285285
was_published_recently() should return False for questions whose
286286
pub_date is older than 1 day.
287287
"""
288-
time = timezone.now() - datetime.timedelta(days=30)
288+
time = timezone.now() - datetime.timedelta(days=1)
289289
old_question = Question(pub_date=time)
290290
self.assertIs(old_question.was_published_recently(), False)
291291

@@ -294,7 +294,7 @@ more comprehensively:
294294
was_published_recently() should return True for questions whose
295295
pub_date is within the last day.
296296
"""
297-
time = timezone.now() - datetime.timedelta(hours=1)
297+
time = timezone.now() - datetime.timedelta(hours=23, minutes=59, seconds=59)
298298
recent_question = Question(pub_date=time)
299299
self.assertIs(recent_question.was_published_recently(), True)
300300

0 commit comments

Comments
 (0)