django-with-asserts:使用上下文管理器测试Django HTML

时间:2021-04-27 12:49:22
【文件属性】:
文件名称:django-with-asserts:使用上下文管理器测试Django HTML
文件大小:20KB
文件格式:ZIP
更新时间:2021-04-27 12:49:22
Python django-with-asserts-使用上下文管理器测试HTML 使您的Django HTML测试更加明确和简洁。 转这个: self.assertContains( resp, '<input id="id_email" type="text" name="email" maxlength="75" value="bob@example.com>', html=True ) 变成这个: with self.assertHTML(resp, 'input[name="email"]') as (elem,): self.assertEqual(elem.value, 'bob@example.com') 链接 文档: : 代码: :
【文件预览】:
django-with-asserts-master
----setup.py(867B)
----.gitignore(60B)
----Makefile(107B)
----.travis.yml(366B)
----README.rst(687B)
----tests()
--------test.sh(75B)
--------project()
--------simple()
--------manage.py(250B)
----docs()
--------_templates()
--------_build()
--------Makefile(5KB)
--------index.rst(7KB)
--------conf.py(8KB)
--------_static()
--------make.bat(5KB)
----with_asserts()
--------context_manager.py(2KB)
--------__init__.py(178B)
--------mixin.py(1016B)
--------case.py(171B)
----tox.ini(685B)

网友评论