Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

FAIL: test_error_logging (django_extensions.tests.management_command.CommandTest) #279

Closed
miratcan opened this Issue Dec 31, 2012 · 8 comments

Comments

Projects
None yet
4 participants
self.assertEqual(len(handler.messages['error']), 1)
    AssertionError: 0 != 1

Is that known error? else i'll send a patch. :o)

Owner

trbs commented Dec 31, 2012

I don't think it's a known error.

Strange it seems to pass travis...

I'm happy to accept a patch :)

stanhu commented Jan 20, 2013

This test only passes if INSTALLED_APPS includes:

'django_extensions.tests'

That's because this test relies on tests/management/commands/error_raising_command.py to be imported.

I'm not sure how to make this test work without changing settings.py because the command list is imported before the tests/init.py is even called.

Owner

trbs commented Jan 20, 2013

Please try it with version efbea83

stanhu commented Jan 20, 2013

I already tried something like this. This trick doesn't work because execute() in django.core.management.init.py calls get_commands(), which loads INSTALLED_APPS before everything is run. The command-list is cached then. Appending to INSTALLED_APPS doesn't affect subsequent calls to get_commands().

Owner

trbs commented Jan 21, 2013

Please try again with the above command.

Now importing the module explicitly via importlib.

stanhu commented Jan 21, 2013

Works now. Thanks!

Owner

trbs commented Jan 21, 2013

Great :)

@trbs trbs closed this Jan 21, 2013

kevart commented Jul 30, 2013

I'm still getting the same error.

FAIL: test_error_logging (django_extensions.tests.management_command.CommandTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/virtenvs/django_slice/local/lib/python2.7/site-packages/django_extensions/tests/management_command.py", line 48, in test_error_logging
    self.assertEqual(len(handler.messages['error']), 1)
AssertionError: 0 != 1

> pip freeze | grep extension
django-extensions==1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment