📜  测试注册用户密码不匹配 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:11.198000             🧑  作者: Mango

代码示例1
def test_register_user_mismatched_passwords(self):
        response = self.client.post('/auth/register', data={
            'username': 'alice',
            'email': 'alice@example.com',
            'password': 'foo',
            'password2': 'bar',
        })
        assert response.status_code == 200
        html = response.get_data(as_text=True)
        assert 'Field must be equal to password.' in html