#22842 closed Bug (fixed)
Test tutorial example contains a bug in code
| Reported by: | soujiro | Owned by: | soujiro |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
https://docs.djangoproject.com/en/dev/intro/tutorial05/#fixing-the-bug
return now - datetime.timedelta(days=1) <= self.pub_date < now
that can create problems with one or more tests.
it should be changed to
return now - datetime.timedelta(days=1) <= self.pub_date <= now
to avoid the case where the field's value is exactly "now"
I've discussed this in DjangoVillage with Baptiste and Daniele, i will submit a patch in a few minutes
Change History (8)
comment:1 by , 11 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 11 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 11 years ago
| Has patch: | set |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
comment:4 by , 11 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Pull request at: https://github.com/django/django/pull/2810