def test_templates_render_successfully():
template_list = []
template_dirs = [
os.path.join(settings.BASE_DIR, 'enrolment/templates'),
os.path.join(settings.BASE_DIR, 'supplier/templates'),
]
for template_dir in template_dirs:
for dir, dirnames, filenames in os.walk(template_dir):
for filename in filenames:
path = os.path.join(dir, filename).replace(template_dir, '')
template_list.append(path.lstrip('/'))
default_context = {
'supplier': None,
'form': Form(),
}
assert template_list
for template in template_list:
render_to_string(template, default_context)
评论列表
文章目录