Integrate with the API for adding and getting webauthn creds

This links up the `get_webauthn_credentials_for_user` and
`create_webauthn_credential_for_user` methods of the user api client to
notifications-api.

To send data to the API we need strings to be unicode, so we call
decode('utf-8') on base64 objects.

Co-authored-by: Leo Hemsted <leo.hemsted@digital.cabinet-office.gov.uk>
This commit is contained in:
Katie Smith
2021-05-13 15:54:05 +01:00
parent 362189d562
commit bafcc02b7d
7 changed files with 60 additions and 24 deletions

View File

@@ -19,8 +19,10 @@ def test_should_show_overview_page(
def test_overview_page_shows_disable_for_platform_admin(
client_request,
platform_admin_user
platform_admin_user,
mocker
):
mocker.patch('app.user_api_client.get_webauthn_credentials_for_user')
client_request.login(platform_admin_user)
page = client_request.get('main.user_profile')
assert page.select_one('h1').text.strip() == 'Your profile'