Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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 soujiro, 10 years ago

Owner: changed from nobody to soujiro
Status: newassigned

comment:2 by Baptiste Mispelon, 10 years ago

Triage Stage: UnreviewedAccepted

comment:3 by soujiro, 10 years ago

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:4 by vagrant <vagrant@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

comment:5 by Daniele Procida <daniele@…>, 10 years ago

In c755c8daa2e05dcf21d4a1b47625fba1e72d7109:

Merge pull request #2810 from magrinidiego/ticket_22842_tutorial_test

Fixed #22842

comment:6 by Baptiste Mispelon <bmispelon@…>, 10 years ago

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

comment:8 by Baptiste Mispelon <bmispelon@…>, 10 years ago

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