Skip to content
Snippets Groups Projects
Commit 2bb2b7f0 authored by Sivert Kronen Hatteberg's avatar Sivert Kronen Hatteberg
Browse files

Fix linting

parent e4d96a07
No related branches found
No related tags found
1 merge request!106Add some OIDC flow tests.
...@@ -7,8 +7,8 @@ AUTHENTICATION_BACKENDS = [ ...@@ -7,8 +7,8 @@ AUTHENTICATION_BACKENDS = [
"sesame.backends.ModelBackend", # link login "sesame.backends.ModelBackend", # link login
] ]
OIDC_RP_CLIENT_ID = 'lalalalala' OIDC_RP_CLIENT_ID = "lalalalala"
OIDC_RP_CLIENT_SECRET = 'lalalalala' OIDC_RP_CLIENT_SECRET = "lalalalala"
LOGIN_REDIRECT_URL = "http://localhost:3000/" LOGIN_REDIRECT_URL = "http://localhost:3000/"
LOGOUT_REDIRECT_URL = "http://localhost:3000/" LOGOUT_REDIRECT_URL = "http://localhost:3000/"
...@@ -42,4 +42,3 @@ Q_CLUSTER = { ...@@ -42,4 +42,3 @@ Q_CLUSTER = {
"orm": "default", "orm": "default",
"sync": True, "sync": True,
} }
...@@ -56,6 +56,7 @@ def id_token_payload(): ...@@ -56,6 +56,7 @@ def id_token_payload():
"nonce": "noncenonce", "nonce": "noncenonce",
} }
@pytest.fixture @pytest.fixture
def data(): def data():
return { return {
...@@ -76,7 +77,7 @@ def data(): ...@@ -76,7 +77,7 @@ def data():
"person1": { "person1": {
"type": "feide_id", "type": "feide_id",
"value": "foo@example.com", "value": "foo@example.com",
"person": { "email": "foo@example.com" } "person": {"email": "foo@example.com"},
}, },
}, },
"Person": { "Person": {
...@@ -84,7 +85,7 @@ def data(): ...@@ -84,7 +85,7 @@ def data():
"first_name": "Foo", "first_name": "Foo",
"last_name": "Baresen", "last_name": "Baresen",
"email": "foo@example.com", "email": "foo@example.com",
}, },
}, },
"Sponsor": { "Sponsor": {
"sponsor1": { "sponsor1": {
...@@ -101,10 +102,10 @@ def save_object(model, **kwargs): ...@@ -101,10 +102,10 @@ def save_object(model, **kwargs):
obj.save() obj.save()
return obj return obj
# TODO add person and sponsor # TODO add person and sponsor
OBJECT_MAPPING = { OBJECT_MAPPING = {
"greg" "greg" "person": Person,
"person": Person,
"sponsor": Sponsor, "sponsor": Sponsor,
"user": get_user_model(), "user": get_user_model(),
} }
......
...@@ -2,9 +2,8 @@ import time ...@@ -2,9 +2,8 @@ import time
import pytest import pytest
from django.core.exceptions import SuspiciousOperation from django.core.exceptions import SuspiciousOperation
from django.conf import settings
from greg.models import Identity, Person, Sponsor from greg.models import Identity
from gregui.authentication.auth_backends import GregOIDCBackend from gregui.authentication.auth_backends import GregOIDCBackend
from gregui.models import GregUserProfile from gregui.models import GregUserProfile
...@@ -63,8 +62,8 @@ def test_create_user(claims): ...@@ -63,8 +62,8 @@ def test_create_user(claims):
assert person.last_name == user.last_name assert person.last_name == user.last_name
assert person.email == user.email assert person.email == user.email
ids = Identity.objects.get(person=person, type='feide_id') ids = Identity.objects.get(person=person, type="feide_id")
assert ids.value == 'frank_foreleser@spusers.feide.no' assert ids.value == "frank_foreleser@spusers.feide.no"
def test_update_user(greg_users, claims): def test_update_user(greg_users, claims):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment