Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalBackend
Commits
0a4ed619
Commit
0a4ed619
authored
Sep 09, 2020
by
lukas.burgey
Browse files
Add test for construct_from_userinfo
parent
bf219661
Pipeline
#109036
passed with stage
in 1 minute and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
feudal/backend/models/tests/users.py
View file @
0a4ed619
...
...
@@ -222,3 +222,24 @@ def test_idp_deletion(deployed_deployment, idp, user, service, vo):
state
.
refresh_from_db
()
assert
state
.
is_pending
assert
state
.
is_orphaned
def
test_construct_from_userinfo
(
idp
,
userinfo
):
test_value
=
0
userinfo
=
{
'sub'
:
'foo'
,
'iss'
:
idp
.
issuer_uri
,
'test_value'
:
test_value
,
}
user
=
User
.
construct_from_userinfo
(
userinfo
,
idp
)
assert
user
.
userinfo
[
'test_value'
]
==
test_value
# change the test value and see if the userinfo actually gets changed
test_value
=
1
userinfo
=
{
'sub'
:
'foo'
,
'iss'
:
idp
.
issuer_uri
,
'test_value'
:
test_value
,
}
user
=
User
.
construct_from_userinfo
(
userinfo
,
idp
)
assert
user
.
userinfo
[
'test_value'
]
==
test_value
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment