✅(backend) fix test after dependencies update
The queries needs update to manage save/release in database, this should be improved, but considered ok for now.
This commit is contained in:
@@ -411,7 +411,7 @@ def test_authentication_getter_existing_user_via_email_update_organization(
|
|||||||
|
|
||||||
monkeypatch.setattr(OIDCAuthenticationBackend, "get_userinfo", get_userinfo_mocked)
|
monkeypatch.setattr(OIDCAuthenticationBackend, "get_userinfo", get_userinfo_mocked)
|
||||||
|
|
||||||
with django_assert_num_queries(9):
|
with django_assert_num_queries(11):
|
||||||
user = klass.get_or_create_user(
|
user = klass.get_or_create_user(
|
||||||
access_token="test-token", id_token=None, payload=None
|
access_token="test-token", id_token=None, payload=None
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ def test_api_contacts_update_authenticated_owned(django_assert_num_queries):
|
|||||||
).data
|
).data
|
||||||
new_contact_values["override"] = str(factories.ContactFactory().id)
|
new_contact_values["override"] = str(factories.ContactFactory().id)
|
||||||
|
|
||||||
with django_assert_num_queries(8):
|
with django_assert_num_queries(14):
|
||||||
# user, 2x contact, user, 3x check, update contact
|
# user, 2x contact, user, 3x check, update contact, 3x savepoint/release
|
||||||
response = client.put(
|
response = client.put(
|
||||||
f"/api/v1.0/contacts/{contact.id!s}/",
|
f"/api/v1.0/contacts/{contact.id!s}/",
|
||||||
new_contact_values,
|
new_contact_values,
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ def test_models_team_accesses_unique():
|
|||||||
|
|
||||||
with pytest.raises(
|
with pytest.raises(
|
||||||
ValidationError,
|
ValidationError,
|
||||||
match="Team/user relation with this User and Team already exists.",
|
match="This user is already in this team.",
|
||||||
):
|
):
|
||||||
factories.TeamAccessFactory(user=access.user, team=access.team)
|
factories.TeamAccessFactory(user=access.user, team=access.team)
|
||||||
|
|
||||||
|
|||||||
@@ -478,9 +478,13 @@ class Base(Configuration):
|
|||||||
environ_prefix=None,
|
environ_prefix=None,
|
||||||
)
|
)
|
||||||
|
|
||||||
USER_OIDC_FIELDS_TO_FULLNAME = values.ListValue(
|
OIDC_USERINFO_FULLNAME_FIELDS = values.ListValue(
|
||||||
default=["first_name", "last_name"],
|
default=values.ListValue( # retrocompatibility
|
||||||
environ_name="USER_OIDC_FIELDS_TO_FULLNAME",
|
default=["first_name", "last_name"],
|
||||||
|
environ_name="USER_OIDC_FIELDS_TO_FULLNAME",
|
||||||
|
environ_prefix=None,
|
||||||
|
),
|
||||||
|
environ_name="OIDC_USERINFO_FULLNAME_FIELDS",
|
||||||
environ_prefix=None,
|
environ_prefix=None,
|
||||||
)
|
)
|
||||||
OIDC_ORGANIZATION_REGISTRATION_ID_FIELD = values.Value(
|
OIDC_ORGANIZATION_REGISTRATION_ID_FIELD = values.Value(
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ backend:
|
|||||||
key: OIDC_RP_CLIENT_SECRET
|
key: OIDC_RP_CLIENT_SECRET
|
||||||
OIDC_RP_SIGN_ALGO: RS256
|
OIDC_RP_SIGN_ALGO: RS256
|
||||||
OIDC_RP_SCOPES: "openid email siret given_name usual_name"
|
OIDC_RP_SCOPES: "openid email siret given_name usual_name"
|
||||||
USER_OIDC_FIELDS_TO_FULLNAME: "given_name,usual_name"
|
OIDC_USERINFO_FULLNAME_FIELDS: "given_name,usual_name"
|
||||||
OIDC_REDIRECT_ALLOWED_HOSTS: https://desk.127.0.0.1.nip.io
|
OIDC_REDIRECT_ALLOWED_HOSTS: https://desk.127.0.0.1.nip.io
|
||||||
OIDC_AUTH_REQUEST_EXTRA_PARAMS: "{'acr_values': 'eidas1'}"
|
OIDC_AUTH_REQUEST_EXTRA_PARAMS: "{'acr_values': 'eidas1'}"
|
||||||
OAUTH2_PROVIDER_OIDC_ENABLED: True
|
OAUTH2_PROVIDER_OIDC_ENABLED: True
|
||||||
|
|||||||
Reference in New Issue
Block a user