html_form_to_dict:HTML格式到字典 源码
HTML格式到字典 这是一个微型库,提供了一个名为html_form_to_dict()的方法。 此方法采用包含HTML的字符串,并返回第一种形式的值的字典。 您可以在这样的测试中使用它: def test_foo ( user_client ): url = reverse ( 'foo' ) response = user_client . get ( url ) data = html_form_to_dict ( response . content ) # <==================== assert data == { 'city' : 'Chemnitz' , 'name' : 'Mr. X' } data [ 'name' ] = 'Mrs. Y' response = user_client . post
下载地址
用户评论