Example #1
0
def test_delete_sign_up_link(api_client: TestClient, api_routes: AppRoutes,
                             token, active_link: SignUpToken, sign_up_user):
    response = api_client.delete(api_routes.users_sign_ups_token(
        active_link.token),
                                 headers=token)
    assert response.status_code == 200

    # Validate Token is Gone
    response = api_client.get(api_routes.users_sign_ups, headers=token)
    assert sign_up_user not in json.loads(response.content)
Example #2
0
def test_new_user_signup(api_client: TestClient, api_routes: AppRoutes,
                         active_link: SignUpToken, sign_up_user):

    # Creation
    response = api_client.post(api_routes.users_sign_ups_token(
        active_link.token),
                               json=sign_up_user)
    assert response.status_code == 200

    # Login
    form_data = {
        "username": "******",
        "password": "******"
    }
    response = api_client.post(api_routes.auth_token, form_data)

    assert response.status_code == 200