summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorErwin Junge <erwin@junge.nl>2021-05-05 20:46:05 +0200
committerErwin Junge <erwin@junge.nl>2021-05-05 22:05:09 +0200
commiteb4688163edc9d2b9b01d62ec3984b6c968b6f86 (patch)
tree806045839cbee0fb2f6ce9bf16ba2dba9cda8c5d /tests
parent3bf6199fbde6c47eab79d88b4e3a21106f81c8d0 (diff)
downloadpysaml2-eb4688163edc9d2b9b01d62ec3984b6c968b6f86.tar.gz
Response issuer can be None
Diffstat (limited to 'tests')
-rw-r--r--tests/test_41_response.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_41_response.py b/tests/test_41_response.py
index 9f1dab6b..54f68c47 100644
--- a/tests/test_41_response.py
+++ b/tests/test_41_response.py
@@ -71,6 +71,16 @@ class TestResponse:
name_id=name_id,
authn=AUTHN)
+ self._resp_issuer_none = server.create_authn_response(
+ IDENTITY,
+ "id12", # in_response_to
+ "http://lingon.catalogix.se:8087/",
+ # consumer_url
+ "urn:mace:example.com:saml:roland:sp",
+ # sp_entity_id
+ name_id=name_id)
+ self._resp_issuer_none.issuer = None
+
conf = config.SPConfig()
conf.load_file("server_conf")
self.conf = conf
@@ -99,6 +109,19 @@ class TestResponse:
assert isinstance(resp, StatusResponse)
assert isinstance(resp, AuthnResponse)
+ def test_issuer_none(self):
+ xml_response = ("%s" % (self._resp_issuer_none,))
+ resp = response_factory(xml_response, self.conf,
+ return_addrs=[
+ "http://lingon.catalogix.se:8087/"],
+ outstanding_queries={
+ "id12": "http://localhost:8088/sso"},
+ timeslack=TIMESLACK, decode=False)
+
+ assert isinstance(resp, StatusResponse)
+ assert isinstance(resp, AuthnResponse)
+ assert resp.issuer() == ""
+
@mock.patch('saml2.time_util.datetime')
def test_false_sign(self, mock_datetime):
mock_datetime.utcnow = mock.Mock(