def test_crispy_filter_with_form(self):
template = loader.get_template_from_string(u"""
{% load crispy_forms_tags %}
{{ form|crispy }}
""")
c = Context({'form': TestForm()})
html = template.render(c)
self.assertTrue("<td>" not in html)
self.assertTrue("id_is_company" in html)
self.assertEqual(html.count('<label'), 7)
评论列表
文章目录