Django 1.6b4 fails to run tests with runner test.simple trying to import TransRealMixin

423 views
Skip to first unread message

Matthieu Rigal

unread,
Oct 22, 2013, 12:22:24 PM10/22/13
to django...@googlegroups.com
Hi all,

I know that TransRealMixin already was a problem in the past and I thought it was "fixed" in the meaning that it was incorporated in the project. (https://github.com/django/django/pull/1147)

I tried to run my actual tests (developed on 1.4.x) on the 1.6b4 and here is what comes out when I use the following parameter 

TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner'


Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/__init__.py", line 397, in execute_from_command_line
    utility.execute()
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/__init__.py", line 390, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/commands/test.py", line 50, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/base.py", line 240, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/commands/test.py", line 71, in execute
    super(Command, self).execute(*args, **options)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/base.py", line 283, in execute
    output = self.handle(*args, **options)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/lib/python2.7/site-packages/south/management/commands/test.py", line 8, in handle
    super(Command, self).handle(*args, **kwargs)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/commands/test.py", line 88, in handle
    failures = test_runner.run_tests(test_labels)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/runner.py", line 144, in run_tests
    suite = self.build_suite(test_labels, extra_tests)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/simple.py", line 247, in build_suite
    suite.addTest(build_suite(app))
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/simple.py", line 149, in build_suite
    test_module = get_tests(app_module)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/simple.py", line 101, in get_tests
    test_module = import_module('.'.join(prefix + [TEST_MODULE]))
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/contrib/humanize/tests.py", line 22, in <module>
    from i18n import TransRealMixin
ImportError: cannot import name TransRealMixin

Best,
Matthieu

Ramiro Morales

unread,
Oct 22, 2013, 3:33:41 PM10/22/13
to django...@googlegroups.com
Matthieu,
Could you give us more information about how to reproduce this? i.e. what tests are you trying to run? etc.

Thanks.

--
Ramiro Morales
@ramiromorales

Ramiro Morales

unread,
Oct 22, 2013, 7:26:50 PM10/22/13
to django...@googlegroups.com
On Tue, Oct 22, 2013 at 4:33 PM, Ramiro Morales <cra...@gmail.com> wrote:
>
> Could you give us more information about how to reproduce this? i.e. what tests are you trying to run? etc.

Never mind, I've reproduced it and opened ticket [1]12307.

--
Ramiro Morales
@ramiromorales

1. https://code.djangoproject.com/ticket/21307

Ramiro Morales

unread,
Oct 22, 2013, 10:11:48 PM10/22/13
to django...@googlegroups.com
On Tue, Oct 22, 2013 at 8:26 PM, Ramiro Morales <cra...@gmail.com> wrote:
> On Tue, Oct 22, 2013 at 4:33 PM, Ramiro Morales <cra...@gmail.com> wrote:
>>
>> Could you give us more information about how to reproduce this? i.e. what tests are you trying to run? etc.
>
> Never mind, I've reproduced it and opened ticket [1]12307.

This has been fixed in the 1.6.x branch and the fix will be included
in the soon to be tagged 1.6 rc.

Please test it and report back if you find any additional problems.

Thanks!

Matthieu Rigal

unread,
Oct 23, 2013, 6:47:08 AM10/23/13
to django...@googlegroups.com
Hi Ramiro,

Thanks for the fix ! I've checked the diff and this looks great :-) Also no need to add i18n anymore to the pip, you save some MB and some install time :-)

BUT I actually couldn't test it, because some other changes just prevent me to run any test with any runner...
It tries to apply migrations on the test DB it is creating, which is causing a bunch of problems !

Here is my stacktrace, I think this should happen with just about any app with South enabled and some migrations inside:

Traceback (most recent call last):
  File "./manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/__init__.py", line 408, in execute_from_command_line
    utility.execute()
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/__init__.py", line 401, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/commands/test.py", line 50, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/base.py", line 244, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/commands/test.py", line 71, in execute
    super(Command, self).execute(*args, **options)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/base.py", line 291, in execute
    output = self.handle(*args, **options)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/lib/python2.7/site-packages/south/management/commands/test.py", line 8, in handle
    super(Command, self).handle(*args, **kwargs)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/commands/test.py", line 88, in handle
    failures = test_runner.run_tests(test_labels)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/runner.py", line 146, in run_tests
    old_config = self.setup_databases()
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/runner.py", line 108, in setup_databases
    return setup_databases(self.verbosity, self.interactive, **kwargs)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/test/runner.py", line 282, in setup_databases
    verbosity, autoclobber=not interactive)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/db/backends/creation.py", line 347, in create_test_db
    test_database=True)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/__init__.py", line 159, in call_command
    return klass.execute(*args, **defaults)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/core/management/base.py", line 291, in execute
    output = self.handle(*args, **options)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
    ignore_ghosts = ignore_ghosts,
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/lib/python2.7/site-packages/south/migration/__init__.py", line 200, in migrate_app
    applied_all = check_migration_histories(applied_all, delete_ghosts, ignore_ghosts)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/lib/python2.7/site-packages/south/migration/__init__.py", line 79, in check_migration_histories
    for h in histories:
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/db/models/query.py", line 140, in __iter__
    self._fetch_all()
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/db/models/query.py", line 962, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/db/models/query.py", line 264, in iterator
    for row in compiler.results_iter():
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/db/models/sql/compiler.py", line 687, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/db/models/sql/compiler.py", line 768, in execute_sql
    cursor.execute(sql, params)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/db/backends/utils.py", line 61, in execute
    return self.cursor.execute(sql, params)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/Users/mrigal/dev/_virtualenvs/myo_1.6/src/django/django/db/backends/utils.py", line 61, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "south_migrationhistory" does not exist
LINE 1: ...gration", "south_migrationhistory"."applied" FROM "south_mig...

Thanks Matt
Reply all
Reply to author
Forward
0 new messages