Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
miratcan opened this Issue · 8 comments

4 participants

@miratcan
self.assertEqual(len(handler.messages['error']), 1)
    AssertionError: 0 != 1

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

@trbs
Owner

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

Strange it seems to pass travis...

I'm happy to accept a patch :)

@stanhu

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.

@trbs
Owner

Please try it with version efbea83

@stanhu

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().

@trbs
Owner

Please try again with the above command.

Now importing the module explicitly via importlib.

@stanhu

Works now. Thanks!

@trbs
Owner

Great :)

@trbs trbs closed this
@kevart

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
Something went wrong with that request. Please try again.