test_tags.py 文件源码

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

项目:mes 作者: osess 项目源码 文件源码
def test_as_crispy_errors_form_with_non_field_errors(self):
        template = loader.get_template_from_string(u"""
            {% load crispy_forms_tags %}
            {{ form|as_crispy_errors }}
        """)
        form = TestForm({'password1': "god", 'password2': "wargame"})
        form.is_valid()

        c = Context({'form': form})
        html = template.render(c)
        self.assertTrue("errorMsg" in html or "alert" in html)
        self.assertTrue("<li>Passwords dont match</li>" in html)
        self.assertFalse("<h3>" in html)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号