[Django] #29931: Improve `contrib.humanize.templatetags.humanize.naturalday` and add more test for it

24 views
Skip to first unread message

Django

unread,
Nov 8, 2018, 1:58:34 PM11/8/18
to django-...@googlegroups.com
#29931: Improve `contrib.humanize.templatetags.humanize.naturalday` and add more
test for it
------------------------------------------------+------------------------
Reporter: Hasan Ramezani | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.humanize | Version: 2.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Small change in `contrib.humanize.templatetags.humanize.naturalday` and
test to cover `ValueError` in this function.

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

Django

unread,
Nov 8, 2018, 1:58:45 PM11/8/18
to django-...@googlegroups.com
#29931: Improve `contrib.humanize.templatetags.humanize.naturalday` and add more
test for it
-------------------------------------+-------------------------------------
Reporter: Hasan Ramezani | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: assigned
Component: contrib.humanize | Version: 2.1
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 Hasan Ramezani):

* owner: nobody => Hasan Ramezani
* status: new => assigned


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

Django

unread,
Nov 8, 2018, 2:06:26 PM11/8/18
to django-...@googlegroups.com
#29931: Improve `contrib.humanize.templatetags.humanize.naturalday` and add more
test for it
-------------------------------------+-------------------------------------
Reporter: Hasan Ramezani | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: assigned
Component: contrib.humanize | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* has_patch: 0 => 1


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

Django

unread,
Nov 8, 2018, 7:18:31 PM11/8/18
to django-...@googlegroups.com
#29931: Remove untested ValueError catching in naturalday template filter

-------------------------------------+-------------------------------------
Reporter: Hasan Ramezani | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: assigned
Component: contrib.humanize | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted


Old description:

> Small change in `contrib.humanize.templatetags.humanize.naturalday` and
> test to cover `ValueError` in this function.

New description:

This branch is untested:
{{{
except ValueError:
# Date arguments out of range
}}}
I don't see how that branch could happen if `value` is a date.

--

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

Django

unread,
Nov 9, 2018, 12:16:38 PM11/9/18
to django-...@googlegroups.com
#29931: Remove untested ValueError catching in naturalday template filter
-------------------------------------+-------------------------------------
Reporter: Hasan Ramezani | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed
Component: contrib.humanize | Version: 2.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"f62cf22c48c1aa1badffd675a360e87d5d3ddb23" f62cf22]:
{{{
#!CommitTicketReference repository=""
revision="f62cf22c48c1aa1badffd675a360e87d5d3ddb23"
Fixed #29931 -- Removed unused ValueError handling in naturalday template
tag.
}}}

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

Reply all
Reply to author
Forward
0 new messages