[Django] #22842: Test tutorial example contains a bug in code

2 views
Skip to first unread message

Django

unread,
Jun 15, 2014, 6:31:06 AM6/15/14
to django-...@googlegroups.com
#22842: Test tutorial example contains a bug in code
-------------------------------+--------------------
Reporter: soujiro | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/22842>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 15, 2014, 6:31:29 AM6/15/14
to django-...@googlegroups.com
#22842: Test tutorial example contains a bug in code
-------------------------------+--------------------------------------
Reporter: soujiro | Owner: soujiro
Type: Bug | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by soujiro):

* owner: nobody => soujiro
* needs_better_patch: => 0
* status: new => assigned
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/22842#comment:1>

Django

unread,
Jun 15, 2014, 6:33:53 AM6/15/14
to django-...@googlegroups.com
#22842: Test tutorial example contains a bug in code
-------------------------------+------------------------------------

Reporter: soujiro | Owner: soujiro
Type: Bug | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by bmispelon):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/22842#comment:2>

Django

unread,
Jun 15, 2014, 6:55:03 AM6/15/14
to django-...@googlegroups.com
#22842: Test tutorial example contains a bug in code
-------------------------------------+-------------------------------------

Reporter: soujiro | Owner: soujiro
Type: Bug | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by soujiro):

* has_patch: 0 => 1
* stage: Accepted => Ready for checkin


Comment:

Pull request at: https://github.com/django/django/pull/2810

--
Ticket URL: <https://code.djangoproject.com/ticket/22842#comment:3>

Django

unread,
Jun 15, 2014, 7:11:58 AM6/15/14
to django-...@googlegroups.com
#22842: Test tutorial example contains a bug in code
-------------------------------------+-------------------------------------
Reporter: soujiro | Owner: soujiro
Type: Bug | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by vagrant <vagrant@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"7a1f8414c3b71b6af03e5be9f5f8db115551c410"]:
{{{
#!CommitTicketReference repository=""
revision="7a1f8414c3b71b6af03e5be9f5f8db115551c410"
Fixed #22842
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22842#comment:4>

Django

unread,
Jun 15, 2014, 7:12:00 AM6/15/14
to django-...@googlegroups.com
#22842: Test tutorial example contains a bug in code
-------------------------------------+-------------------------------------
Reporter: soujiro | Owner: soujiro
Type: Bug | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Daniele Procida <daniele@…>):

In [changeset:"c755c8daa2e05dcf21d4a1b47625fba1e72d7109"]:
{{{
#!CommitTicketReference repository=""
revision="c755c8daa2e05dcf21d4a1b47625fba1e72d7109"
Merge pull request #2810 from magrinidiego/ticket_22842_tutorial_test

Fixed #22842
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22842#comment:5>

Django

unread,
Jun 16, 2014, 2:47:14 AM6/16/14
to django-...@googlegroups.com
#22842: Test tutorial example contains a bug in code
-------------------------------------+-------------------------------------
Reporter: soujiro | Owner: soujiro
Type: Bug | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Baptiste Mispelon <bmispelon@…>):

In [changeset:"7342784b99a45cf661fd23f3ffd52eb02ce5cf3a"]:
{{{
#!CommitTicketReference repository=""
revision="7342784b99a45cf661fd23f3ffd52eb02ce5cf3a"
[1.5.x] Fixed #22842

Backport of 7a1f8414c3b71b6af03e5be9f5f8db115551c410 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22842#comment:6>

Django

unread,
Jun 16, 2014, 2:47:16 AM6/16/14
to django-...@googlegroups.com
#22842: Test tutorial example contains a bug in code
-------------------------------------+-------------------------------------
Reporter: soujiro | Owner: soujiro
Type: Bug | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Baptiste Mispelon <bmispelon@…>):

In [changeset:"44a50603d402a40158159e9cc05c776fe67973be"]:
{{{
#!CommitTicketReference repository=""
revision="44a50603d402a40158159e9cc05c776fe67973be"
[1.7.x] Fixed #22842

Backport of 7a1f8414c3b71b6af03e5be9f5f8db115551c410 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22842#comment:7>

Django

unread,
Jun 16, 2014, 2:47:16 AM6/16/14
to django-...@googlegroups.com
#22842: Test tutorial example contains a bug in code
-------------------------------------+-------------------------------------
Reporter: soujiro | Owner: soujiro
Type: Bug | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Baptiste Mispelon <bmispelon@…>):

In [changeset:"b0e5a527dbd2f242fa59fa8f40b7f2de4d55d57a"]:
{{{
#!CommitTicketReference repository=""
revision="b0e5a527dbd2f242fa59fa8f40b7f2de4d55d57a"
[1.6.x] Fixed #22842

Backport of 7a1f8414c3b71b6af03e5be9f5f8db115551c410 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22842#comment:8>

Reply all
Reply to author
Forward
0 new messages