Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Debian New Member Process
contributors.debian.org
Commits
041321a6
Commit
041321a6
authored
Jan 10, 2021
by
Enrico Zini
Browse files
Make tests independent from identity str() implementation
parent
49582dc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
signon/tests/test_authentication.py
View file @
041321a6
...
...
@@ -308,6 +308,7 @@ class TestAuthentication(SignonFixtureMixin, TestCase):
# One bound debsso account
self
.
identities
.
create
(
"debsso"
,
issuer
=
"debsso"
,
subject
=
"new@debian.org"
,
audit_skip
=
True
)
debsso_identity_str
=
str
(
self
.
identities
.
debsso
)
def
_instantiate_identities
(
_self
,
request
):
request
.
signon_identities
=
{
...
...
@@ -323,8 +324,8 @@ class TestAuthentication(SignonFixtureMixin, TestCase):
person
=
self
.
identities
.
debsso
.
person
self
.
assertEqual
(
log
.
output
,
[
f
"INFO:signon.middleware:
{
person
}
: auto created from identity
-:
debsso
:new@debian.org (no remote username)
"
,
f
"INFO:signon.middleware:
{
person
}
: auto bound to identity
{
person
}
:debsso:new@debian.org (no remote username)
"
,
f
"INFO:signon.middleware:
{
person
}
: auto created from identity
{
debsso
_identity_str
}
"
,
f
"INFO:signon.middleware:
{
person
}
: auto bound to identity
{
self
.
identities
.
debsso
}
"
,
])
self
.
assertEqual
(
response
.
status_code
,
200
)
...
...
@@ -346,6 +347,7 @@ class TestAuthentication(SignonFixtureMixin, TestCase):
# One bound debsso account
self
.
identities
.
create
(
"salsa"
,
issuer
=
"salsa"
,
subject
=
"2"
,
username
=
"new"
,
audit_skip
=
True
)
salsa_identity_str
=
str
(
self
.
identities
.
salsa
)
def
_instantiate_identities
(
_self
,
request
):
request
.
signon_identities
=
{
...
...
@@ -361,8 +363,8 @@ class TestAuthentication(SignonFixtureMixin, TestCase):
person
=
self
.
identities
.
salsa
.
person
self
.
assertEqual
(
log
.
output
,
[
f
"INFO:signon.middleware:
{
person
}
: auto created from identity
-:
salsa
:2 (aka new)
"
,
f
"INFO:signon.middleware:
{
person
}
: auto bound to identity
{
person
}
:salsa:2 (aka new)
"
,
f
"INFO:signon.middleware:
{
person
}
: auto created from identity
{
salsa
_identity_str
}
"
,
f
"INFO:signon.middleware:
{
person
}
: auto bound to identity
{
self
.
identities
.
salsa
}
"
,
])
self
.
assertEqual
(
response
.
status_code
,
200
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment