Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#22842 closed Bug (fixed)

Test tutorial example contains a bug in code

Reported by: soujiro Owned by: soujiro
Component: Documentation Version: master
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 Changed 7 years ago by soujiro

Owner: changed from nobody to soujiro
Status: newassigned

comment:2 Changed 7 years ago by Baptiste Mispelon

Triage Stage: UnreviewedAccepted

comment:3 Changed 7 years ago by soujiro

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:4 Changed 7 years ago by vagrant <vagrant@…>

Resolution: fixed
Status: assignedclosed

comment:5 Changed 7 years ago by Daniele Procida <daniele@…>

In c755c8daa2e05dcf21d4a1b47625fba1e72d7109:

Merge pull request #2810 from magrinidiego/ticket_22842_tutorial_test

Fixed #22842

comment:6 Changed 7 years ago by Baptiste Mispelon <bmispelon@…>

comment:7 Changed 7 years ago by Baptiste Mispelon <bmispelon@…>

comment:8 Changed 7 years ago by Baptiste Mispelon <bmispelon@…>

Note: See TracTickets for help on using tickets.
Back to Top