Debug unittests

I have some problems debugging code from unittest in Django.
Although I run unittest, I have output

FAIL: test_basket (api.api_1_0.tests.basket_tests.BasketTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dasm/apps/filmaster/reloaded/film20/api/api_1_0/tests/basket_tests.py", line 13, in test_basket
    self.assertEquals(status, 200)
AssertionError: 400 != 200

but when my colleague runs the same test, he gets

2011-06-10 14:58:33,221 - WARNING:notification.models - No module named APNSWrapper - @<module>/96
/home/michuk/djcode/filmaster-reloaded/piston/handler.py:36: UserWarning: Handler already registered for model ChannelScreenings, you may experience inconsistent results.
  "you may experience inconsistent results." % new_cls.model.__name__)
2011-06-10 14:58:33,844 - ERROR:film20.api.api_1_0.handlers - extra() got an unexpected keyword argument 'join' - @error_handler/93
Traceback (most recent call last):
  File "/home/michuk/djcode/filmaster-reloaded/piston/resource.py", line 164, in __call__
    result = meth(request, *args, **kwargs)
  File "/home/michuk/djcode/filmaster-reloaded/film20/api/api_1_0/handlers.py", line 161, in wrapper
    return view(self, request, request.username, *args, **kw)
  File "/home/michuk/djcode/filmaster-reloaded/film20/api/api_1_0/handlers.py", line 1051, in read
    return paginated_collection(request, BasketItem.objects.user_items(username, type).select_related('user', 'film'))
  File "/home/michuk/djcode/filmaster-reloaded/film20/filmbasket/models.py", line 67, in user_items
    join=['LEFT OUTER JOIN "core_recommendation" ON ("filmbasket_basketitem"."film_id" = "core_recommendation"."film_id" and "filmbasket_basketitem"."user_id" = "core_recommendation"."user_id")'],
TypeError: extra() got an unexpected keyword argument 'join'

Failure
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/utils/unittest/case.py", line 339, in run
    testMethod()
  File "/home/michuk/djcode/filmaster-reloaded/film20/api/api_1_0/tests/basket_tests.py", line 15, in test_basket
    self.assertEquals(status, 200)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/unittest/case.py", line 520, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/unittest/case.py", line 513, in _baseAssertEqual
    raise self.failureException(msg)
AssertionError: 400 != 200

As you can see, the second stacktrace is much more efficient than the one I have. Can I change my settings (or set something) to expand my stack?

change
OS: Ubuntu 11.04
Python: 2.7.1
pdb installed

+3
source share
1 answer

I'm not quite sure that he gets more information than you. It could just be because other things are missing for him because of missing modules or something else in his setup.

, , , . , unittest, , . , , , , , . , , .

+1

All Articles