tests.test_enrollment

Test enrollment endpoint

Module Contents

Functions

test_enroll_verif_code(tilauspalvelu_jwt_admin_client)

Test - verification code should succeed

test_enroll_verif_code_fail_no_jwt(unauth_client)

Test - No JWT --> fail

test_enroll_show_verif_code(tilauspalvelu_jwt_admin_client)

Test - show verification code info

test_enroll_show_verifcode_bad_code(...)

Test - show verification code info

test_show_verifcode_no_jwt(unauth_client)

Test - no JWT, should fail

test_show_verifcode_no_permission(...)

Test - no such code --> fail

test_show_verifcode_sub_is_bonkers(...)

Test - sub in JWT cannot be found

test_have_i_been_accepted_yes(...)

Test - have i been accepted, yes

test_have_i_been_accepted_no(...)

Test - have i been accepted, no

test_have_i_been_accepted_no_jwt(unauth_client)

Test - have i been - no JWt

test_status_koira(tilauspalvelu_jwt_admin_client)

Test - get status

test_status_not_found(tilauspalvelu_jwt_admin_client)

Test - no such status

test_list_as_adm(tilauspalvelu_jwt_admin_client)

Test - list enrollments

test_list_as_usr(tilauspalvelu_jwt_user_client)

Test - list enrollments as normal user

test_post_init(tilauspalvelu_jwt_admin_client)

Test - init new user

test_init_as_usr(tilauspalvelu_jwt_user_client)

Test - init as normal user --> fail

test_promote_demote(tilauspalvelu_jwt_admin_client)

Test - promote user

test_promote_as_usr(tilauspalvelu_jwt_user_client)

Test - promote user, no permissions

test_lock(tilauspalvelu_jwt_admin_client)

Test - lock

test_lock_as_usr(tilauspalvelu_jwt_user_client)

Test - lock as normal use

test_accept(tilauspalvelu_jwt_admin_client)

Test - accept enrollment

test_accept_as_usr(tilauspalvelu_jwt_user_client)

Test - accept, no permissions -> fail

test_accept_no_such_user(tilauspalvelu_jwt_admin_client)

Test - accept a ghost

test_invitecode_create(tilauspalvelu_jwt_admin_client)

Test - create invite code

test_create_as_usr(tilauspalvelu_jwt_user_client)

Test - normal user create invite code --> fail

test_invitecode_dectivate(tilauspalvelu_jwt_admin_client)

Test - deactivate invite code

test_invitecode_activate(tilauspalvelu_jwt_admin_client)

Test - activate invite code

test_invite_code(tilauspalvelu_jwt_admin_client)

Test - check invite code

test_enroll_with_invite_code(...)

Test - enroll with invite code

Attributes

LOGGER

LOGGER[source]
async test_enroll_verif_code(tilauspalvelu_jwt_admin_client)[source]

Test - verification code should succeed

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_enroll_verif_code_fail_no_jwt(unauth_client)[source]

Test - No JWT –> fail

Parameters:

unauth_client (async_asgi_testclient.TestClient)

Return type:

None

async test_enroll_show_verif_code(tilauspalvelu_jwt_admin_client)[source]

Test - show verification code info

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_enroll_show_verifcode_bad_code(tilauspalvelu_jwt_admin_client)[source]

Test - show verification code info

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_show_verifcode_no_jwt(unauth_client)[source]

Test - no JWT, should fail

Parameters:

unauth_client (async_asgi_testclient.TestClient)

Return type:

None

async test_show_verifcode_no_permission(tilauspalvelu_jwt_user_client)[source]

Test - no such code –> fail

Parameters:

tilauspalvelu_jwt_user_client (async_asgi_testclient.TestClient)

Return type:

None

async test_show_verifcode_sub_is_bonkers(tilauspalvelu_jwt_without_proper_user_client)[source]

Test - sub in JWT cannot be found

Parameters:

tilauspalvelu_jwt_without_proper_user_client (async_asgi_testclient.TestClient)

Return type:

None

async test_have_i_been_accepted_yes(tilauspalvelu_jwt_user_client)[source]

Test - have i been accepted, yes

Parameters:

tilauspalvelu_jwt_user_client (async_asgi_testclient.TestClient)

Return type:

None

async test_have_i_been_accepted_no(tilauspalvelu_jwt_user_koira_client)[source]

Test - have i been accepted, no

Parameters:

tilauspalvelu_jwt_user_koira_client (async_asgi_testclient.TestClient)

Return type:

None

async test_have_i_been_accepted_no_jwt(unauth_client)[source]

Test - have i been - no JWt

Parameters:

unauth_client (async_asgi_testclient.TestClient)

Return type:

None

async test_status_koira(tilauspalvelu_jwt_admin_client)[source]

Test - get status

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_status_not_found(tilauspalvelu_jwt_admin_client)[source]

Test - no such status

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_list_as_adm(tilauspalvelu_jwt_admin_client)[source]

Test - list enrollments

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_list_as_usr(tilauspalvelu_jwt_user_client)[source]

Test - list enrollments as normal user

Parameters:

tilauspalvelu_jwt_user_client (async_asgi_testclient.TestClient)

Return type:

None

async test_post_init(tilauspalvelu_jwt_admin_client)[source]

Test - init new user

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_init_as_usr(tilauspalvelu_jwt_user_client)[source]

Test - init as normal user –> fail

Parameters:

tilauspalvelu_jwt_user_client (async_asgi_testclient.TestClient)

Return type:

None

async test_promote_demote(tilauspalvelu_jwt_admin_client)[source]

Test - promote user

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_promote_as_usr(tilauspalvelu_jwt_user_client)[source]

Test - promote user, no permissions

Parameters:

tilauspalvelu_jwt_user_client (async_asgi_testclient.TestClient)

Return type:

None

async test_lock(tilauspalvelu_jwt_admin_client)[source]

Test - lock

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_lock_as_usr(tilauspalvelu_jwt_user_client)[source]

Test - lock as normal use

Parameters:

tilauspalvelu_jwt_user_client (async_asgi_testclient.TestClient)

Return type:

None

async test_accept(tilauspalvelu_jwt_admin_client)[source]

Test - accept enrollment

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_accept_as_usr(tilauspalvelu_jwt_user_client)[source]

Test - accept, no permissions -> fail

Parameters:

tilauspalvelu_jwt_user_client (async_asgi_testclient.TestClient)

Return type:

None

async test_accept_no_such_user(tilauspalvelu_jwt_admin_client)[source]

Test - accept a ghost

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_invitecode_create(tilauspalvelu_jwt_admin_client)[source]

Test - create invite code

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_create_as_usr(tilauspalvelu_jwt_user_client)[source]

Test - normal user create invite code –> fail

Parameters:

tilauspalvelu_jwt_user_client (async_asgi_testclient.TestClient)

Return type:

None

async test_invitecode_dectivate(tilauspalvelu_jwt_admin_client)[source]

Test - deactivate invite code

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_invitecode_activate(tilauspalvelu_jwt_admin_client)[source]

Test - activate invite code

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_invite_code(tilauspalvelu_jwt_admin_client)[source]

Test - check invite code

Parameters:

tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

Return type:

None

async test_enroll_with_invite_code(tilauspalvelu_jwt_admin_client, unauth_client)[source]

Test - enroll with invite code

Parameters:
  • tilauspalvelu_jwt_admin_client (async_asgi_testclient.TestClient)

  • unauth_client (async_asgi_testclient.TestClient)

Return type:

None