Skip to content

Commit

Permalink
Change usage of middleName to lastName
Browse files Browse the repository at this point in the history
  • Loading branch information
pehala committed May 27, 2024
1 parent cfd830b commit 023fea5
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions testsuite/tests/kuadrant/authorino/dinosaur/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,30 +231,31 @@ def authorization(authorization, keycloak, terms_and_conditions, cluster_info, a
@pytest.fixture(scope="module")
def user_with_valid_org_id(keycloak, blame):
"""
Creates new user with valid middle name.
Middle name is mapped to org ID in auth config.
Creates new user with valid last name.
last name is mapped to org ID in auth config.
"""
user = keycloak.realm.create_user(blame("someuser"), blame("password"))
user.assign_attribute({"middleName": "123"})
user = keycloak.realm.create_user(blame("someuser"), blame("password"), lastName="123")
return HttpxOidcClientAuth.from_user(keycloak.get_token, user=user)


@pytest.fixture(scope="module", params=["321", None])
def user_with_invalid_org_id(keycloak, blame, request):
# https://github.com/Kuadrant/testsuite/issues/396
# @pytest.fixture(scope="module", params=["321", None])
@pytest.fixture(scope="module")
def user_with_invalid_org_id(keycloak, blame):
"""
Creates new user with valid middle name.
Middle name is mapped to org ID in auth config.
Creates new user with valid last name.
last name is mapped to org ID in auth config.
"""
user = keycloak.realm.create_user(blame("someuser"), blame("password"))
user.assign_attribute({"middleName": request.param})
user = keycloak.realm.create_user(blame("someuser"), blame("password"), lastName="321")
return HttpxOidcClientAuth.from_user(keycloak.get_token, user=user)


@pytest.fixture(scope="module")
def user_with_invalid_email(keycloak, blame):
"""Creates new user with invalid email"""
user = keycloak.realm.create_user(blame("someuser"), blame("password"), email="[email protected]")
user.assign_attribute({"middleName": "123"})
user = keycloak.realm.create_user(
blame("someuser"), blame("password"), email="[email protected]", lastName="123"
)
return HttpxOidcClientAuth.from_user(keycloak.get_token, user=user)


Expand Down

0 comments on commit 023fea5

Please sign in to comment.