Commit 041321a6 authored by Enrico Zini's avatar Enrico Zini
Browse files

Make tests independent from identity str() implementation

parent 49582dc6
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment