test_tags.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:mes 作者: osess 项目源码 文件源码
def test_crispy_field_and_class_converters(self):
        if hasattr(settings, 'CRISPY_CLASS_CONVERTERS'):
            template = loader.get_template_from_string(u"""
                {% load crispy_forms_field %}
                {% crispy_field testField 'class' 'error' %}
            """)
            test_form = TestForm()
            field_instance = test_form.fields['email']
            bound_field = BoundField(test_form, field_instance, 'email')

            c = Context({'testField': bound_field})
            html = template.render(c)
            self.assertTrue('error' in html)
            self.assertTrue('inputtext' in html)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号