Jos*_*ian 5 django django-templates django-testing
根据Django测试文档,Django客户端Response对象包含"templates",它是:"用于呈现最终内容的Template实例列表,按照呈现的顺序.对于列表中的每个模板,使用模板.如果模板是从文件加载的,则获取模板文件名的名称.(名称是一个字符串,例如'admin/index.html'.)"
但是,我得到一个空的模板列表,即使我确信模板已呈现.
from django.test.client import Client
c = Client()
response = c.post('/signup/', {'email': 'a@b.com', 'password1': 'smith', 'password2': 'smith'}, follow=True)
print response.templates
# []
Run Code Online (Sandbox Code Playgroud)
为什么模板是空的?如何查看呈现的模板?
归档时间: |
|
查看次数: |
969 次 |
最近记录: |