У меня есть некоторые проблемы с отладкой кода из unittest в Django.
Пока я запускаю unittest, у меня выводится
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
, но когда мой коллега запускает тот же тест, он получает
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
Как видите, вторая трассировка стека намного эффективнее той, которая у меня есть.Могу ли я изменить свои настройки (или установить что-нибудь), чтобы расширить мою трассировку стека?
edit:
ОС: Ubuntu 11.04
Python: 2.7.1
pdb установлен