Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
greg
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
it-bott-integrasjoner
greg
Commits
b83bd624
Commit
b83bd624
authored
3 years ago
by
Sivert Kronen Hatteberg
Browse files
Options
Downloads
Patches
Plain Diff
Fix linting
parent
89aa74e3
No related branches found
No related tags found
No related merge requests found
Pipeline
#96809
passed
3 years ago
Stage: venv update
Stage: tests and linting
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gregsite/settings/testing.py
+2
-3
2 additions, 3 deletions
gregsite/settings/testing.py
gregui/tests/conftest.py
+6
-6
6 additions, 6 deletions
gregui/tests/conftest.py
gregui/tests/test_oidc.py
+3
-4
3 additions, 4 deletions
gregui/tests/test_oidc.py
with
11 additions
and
13 deletions
gregsite/settings/testing.py
+
2
−
3
View file @
b83bd624
...
...
@@ -7,8 +7,8 @@ AUTHENTICATION_BACKENDS = [
"
sesame.backends.ModelBackend
"
,
# link login
]
OIDC_RP_CLIENT_ID
=
'
lalalalala
'
OIDC_RP_CLIENT_SECRET
=
'
lalalalala
'
OIDC_RP_CLIENT_ID
=
"
lalalalala
"
OIDC_RP_CLIENT_SECRET
=
"
lalalalala
"
LOGIN_REDIRECT_URL
=
"
http://localhost:3000/
"
LOGOUT_REDIRECT_URL
=
"
http://localhost:3000/
"
...
...
@@ -42,4 +42,3 @@ Q_CLUSTER = {
"
orm
"
:
"
default
"
,
"
sync
"
:
True
,
}
This diff is collapsed.
Click to expand it.
gregui/tests/conftest.py
+
6
−
6
View file @
b83bd624
...
...
@@ -5,7 +5,6 @@ from rest_framework.test import APIClient
from
django.contrib.auth
import
get_user_model
from
greg.models
import
Person
,
Sponsor
from
gregui.models
import
GregUserProfile
# from greg.models import (
# Consent,
...
...
@@ -49,6 +48,7 @@ def id_token_payload():
"
nonce
"
:
"
noncenonce
"
,
}
@pytest.fixture
def
data
():
return
{
...
...
@@ -69,7 +69,7 @@ def data():
"
person1
"
:
{
"
type
"
:
"
feide_id
"
,
"
value
"
:
"
foo@example.com
"
,
"
person
"
:
{
"
email
"
:
"
foo@example.com
"
}
"
person
"
:
{
"
email
"
:
"
foo@example.com
"
}
,
},
},
"
Person
"
:
{
...
...
@@ -77,7 +77,7 @@ def data():
"
first_name
"
:
"
Foo
"
,
"
last_name
"
:
"
Baresen
"
,
"
email
"
:
"
foo@example.com
"
,
},
},
},
"
Sponsor
"
:
{
"
sponsor1
"
:
{
...
...
@@ -94,10 +94,10 @@ def save_object(model, **kwargs):
obj
.
save
()
return
obj
# TODO add person and sponsor
OBJECT_MAPPING
=
{
"
greg
"
"
person
"
:
Person
,
"
greg
"
"
person
"
:
Person
,
"
sponsor
"
:
Sponsor
,
"
user
"
:
get_user_model
(),
}
...
...
@@ -147,4 +147,4 @@ def log_in(client, greg_users):
session
.
save
()
return
client
return
_log_in
\ No newline at end of file
return
_log_in
This diff is collapsed.
Click to expand it.
gregui/tests/test_oidc.py
+
3
−
4
View file @
b83bd624
...
...
@@ -2,9 +2,8 @@ import time
import
pytest
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.models
import
GregUserProfile
...
...
@@ -63,8 +62,8 @@ def test_create_user(claims):
assert
person
.
last_name
==
user
.
last_name
assert
person
.
email
==
user
.
email
ids
=
Identity
.
objects
.
get
(
person
=
person
,
type
=
'
feide_id
'
)
assert
ids
.
value
==
'
frank_foreleser@spusers.feide.no
'
ids
=
Identity
.
objects
.
get
(
person
=
person
,
type
=
"
feide_id
"
)
assert
ids
.
value
==
"
frank_foreleser@spusers.feide.no
"
def
test_update_user
(
greg_users
,
claims
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment