def test_create_new_user(self):
with responses.RequestsMock() as rsps:
rsps.add(
self.deform_client.user.create.method.upper(),
self.deform_client.user.create.get_context({})['url'],
json={
'message': 'Check your email for confirmation code'
},
status=201
)
response = self.deform_client.user.create(
email='a' + self.CONFIG['DEFORM']['EMAIL'],
password=self.CONFIG['DEFORM']['PASSWORD']
)
assert_that(
response,
has_entry('message', 'Check your email for confirmation code')
)
评论列表
文章目录