is there a way to test that the response.context object the test client returns, a RequestContext object i开发者_JS百科s? I checked the source code and it seems they wrap the context in a ContextList object.
Check if the ContextList is not empty, then check the item which is a RequestContext
object:
from django.template import RequestContext
response = client.post(...)
context_list = response.context
for context in context_list:
if isinstance(context, RequestContext):
# do some more test checks here
精彩评论