def test_confirm_already_confirmed_code(self):
with responses.RequestsMock() as rsps:
rsps.add(
self.deform_client.user.confirm.method.upper(),
self.deform_client.user.confirm.get_context({})['url'],
json={
'message': 'User already exists.'
},
status=409
)
assert_that(
calling(self.deform_client.user.confirm).with_args(
code='12345'
),
raises(ConflictError, '^User already exists\.$')
)
评论列表
文章目录