[Django] #21307: humanize tests depend on a test case mixin defined on tests/i18n/__init__.py

13 views
Skip to first unread message

Django

unread,
Oct 22, 2013, 7:25:05 PM10/22/13
to django-...@googlegroups.com
#21307: humanize tests depend on a test case mixin defined on
tests/i18n/__init__.py
---------------------------------------------+------------------------
Reporter: ramiro | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
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 |
---------------------------------------------+------------------------
As reported in django-users (https://groups.google.com/d/topic/django-
users/u1sycmDbO9c/discussion):

1. Having 'django.contrib.humanize' listed in INSTALLED_APPS
2. Using TEST_RUNNER=
3. Trying to run the tests using `manage.py test`

Reported against 1.6b4 but an be reproduced with current 1.6.x and master.

Result of discussion on IRC resulted a suggested fix: Move the
`TransRealMixin` added in 9a1ea4e7e8214a001ca43ae6f0fcea96a5d51489 to a
place under the django hierarchy, i.e. `django.test.utils` that would
allow it to be imported using an absolute import.

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

Django

unread,
Oct 22, 2013, 7:27:28 PM10/22/13
to django-...@googlegroups.com
#21307: humanize tests depend on a test case mixin defined on
tests/i18n/__init__.py
-----------------------------------+--------------------------------------

Reporter: ramiro | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | 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
-----------------------------------+--------------------------------------
Description changed by ramiro:

Old description:

> As reported in django-users (https://groups.google.com/d/topic/django-
> users/u1sycmDbO9c/discussion):
>
> 1. Having 'django.contrib.humanize' listed in INSTALLED_APPS
> 2. Using TEST_RUNNER=
> 3. Trying to run the tests using `manage.py test`
>
> Reported against 1.6b4 but an be reproduced with current 1.6.x and
> master.
>
> Result of discussion on IRC resulted a suggested fix: Move the
> `TransRealMixin` added in 9a1ea4e7e8214a001ca43ae6f0fcea96a5d51489 to a
> place under the django hierarchy, i.e. `django.test.utils` that would
> allow it to be imported using an absolute import.

New description:

As reported in django-users (https://groups.google.com/d/topic/django-
users/u1sycmDbO9c/discussion):

1. Having 'django.contrib.humanize' listed in INSTALLED_APPS

2. Using TEST_RUNNER='django.test.simple.DjangoTestSuiteRunner'


3. Trying to run the tests using `manage.py test`

Reported against 1.6b4 but an be reproduced with current 1.6.x and master.

Result of discussion on IRC resulted a suggested fix: Move the
`TransRealMixin` added in 9a1ea4e7e8214a001ca43ae6f0fcea96a5d51489 to a
place under the django hierarchy, i.e. `django.test.utils` that would
allow it to be imported using an absolute import.

--

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

Django

unread,
Oct 22, 2013, 7:39:48 PM10/22/13
to django-...@googlegroups.com
#21307: humanize tests depend on a test case mixin defined on
tests/i18n/__init__.py
-----------------------------------+------------------------------------

Reporter: ramiro | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

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


Comment:

This is the actual error output:
{{{
$ ./manage.py test
django/test/_doctest.py:57: DeprecationWarning: The django.test._doctest
module is deprecated; use the doctest module from the Python standard
library instead. DeprecationWarning)

django/test/simple.py:26: DeprecationWarning: The django.test.simple
module and DjangoTestSuiteRunner are deprecated; use
django.test.runner.DiscoverRunner instead. DeprecationWarning)

Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "django/core/management/__init__.py", line 408, in
execute_from_command_line
utility.execute()
File "django/core/management/__init__.py", line 401, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "django/core/management/commands/test.py", line 50, in
run_from_argv
super(Command, self).run_from_argv(argv)
File "django/core/management/base.py", line 244, in run_from_argv
self.execute(*args, **options.__dict__)
File "django/core/management/commands/test.py", line 71, in execute
super(Command, self).execute(*args, **options)
File "django/core/management/base.py", line 291, in execute
output = self.handle(*args, **options)
File "django/core/management/commands/test.py", line 88, in handle
failures = test_runner.run_tests(test_labels)
File "django/test/runner.py", line 145, in run_tests
suite = self.build_suite(test_labels, extra_tests)
File "django/test/simple.py", line 249, in build_suite
suite.addTest(build_suite(app))
File "django/test/simple.py", line 151, in build_suite
test_module = get_tests(app_module)
File "django/test/simple.py", line 103, in get_tests
test_module = import_module('.'.join(prefix + [TEST_MODULE]))
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
import_module
__import__(name)
File "django/contrib/humanize/tests.py", line 21, in <module>
from i18n import TransRealMixin
ImportError: No module named i18n
}}}

I've opened a PR with a propsed fix:
https://github.com/django/django/pull/1796

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

Django

unread,
Oct 22, 2013, 7:45:11 PM10/22/13
to django-...@googlegroups.com
#21307: humanize tests depend on a test case mixin defined on
tests/i18n/__init__.py
-----------------------------------+-------------------------------------
Reporter: ramiro | Owner: anonymous
Type: Bug | Status: assigned

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* owner: nobody => anonymous
* status: new => assigned


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

Django

unread,
Oct 22, 2013, 7:53:47 PM10/22/13
to django-...@googlegroups.com
#21307: humanize tests depend on a test case mixin defined on
tests/i18n/__init__.py
-------------------------------------+-------------------------------------

Reporter: ramiro | Owner: anonymous
Type: Bug | Status: assigned
Component: Testing framework | 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 timo):

* stage: Accepted => Ready for checkin


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

Django

unread,
Oct 22, 2013, 9:34:48 PM10/22/13
to django-...@googlegroups.com
#21307: humanize tests depend on a test case mixin defined on
tests/i18n/__init__.py
-------------------------------------+-------------------------------------
Reporter: ramiro | Owner: anonymous
Type: Bug | Status: closed

Component: Testing framework | 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 Ramiro Morales <cramm0@…>):

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


Comment:

In [changeset:"51d2e1fb233b5507bf14300787939717c4d93834"]:
{{{
#!CommitTicketReference repository=""
revision="51d2e1fb233b5507bf14300787939717c4d93834"
Fixed #21307 -- Moved TransRealMixin to django.test.utils.
}}}

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

Django

unread,
Oct 22, 2013, 10:09:03 PM10/22/13
to django-...@googlegroups.com
#21307: humanize tests depend on a test case mixin defined on
tests/i18n/__init__.py
-------------------------------------+-------------------------------------
Reporter: ramiro | Owner: anonymous
Type: Bug | Status: closed
Component: Testing framework | 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 Ramiro Morales <cramm0@…>):

In [changeset:"bcc65c13a086f3e6d24dc7fc92a167fd836af501"]:
{{{
#!CommitTicketReference repository=""
revision="bcc65c13a086f3e6d24dc7fc92a167fd836af501"
[1.6.x] Fixed #21307 -- Moved TransRealMixin to django.test.utils.

51d2e1fb23 from master.
}}}

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

Reply all
Reply to author
Forward
0 new messages