【发布时间】:2013-05-11 02:36:30
【问题描述】:
我在运行 manage.py 测试后一遍又一遍地得到这个:
ERROR 4280 140735184636256 base: Internal Server Error: /add/error/
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/Library/Python/2.7/site-packages/django/views/decorators/cache.py", line 89, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/Library/Python/2.7/site-packages/django/contrib/messages/tests/urls.py", line 30, in add
getattr(messages, message_type)(request, msg)
File "/Library/Python/2.7/site-packages/django/contrib/messages/api.py", line 102, in error
fail_silently=fail_silently)
File "/Library/Python/2.7/site-packages/django/contrib/messages/api.py", line 22, in add_message
raise MessageFailure('You cannot add messages without installing '
MessageFailure: You cannot add messages without installing django.contrib.messages.middleware.MessageMiddleware
MessageMiddleware 在我的 settings.py 中启用,所以不知道为什么。有什么线索吗?
【问题讨论】:
标签: python django unit-testing