From b40dfabc4403c15c9c64204e34f81fdedb038db0 Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Mon, 2 Nov 2015 10:21:56 -0800 Subject: [PATCH] Make tests work with the latest updates. --- tests/test_12_s_utils.py | 7 ++++--- tests/test_44_authnresp.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_12_s_utils.py b/tests/test_12_s_utils.py index 4e1833f..d6e0c82 100644 --- a/tests/test_12_s_utils.py +++ b/tests/test_12_s_utils.py @@ -97,15 +97,16 @@ def test_status_from_exception(): def test_status_from_tuple(): - stat = utils.error_status_factory((samlp.STATUS_UNKNOWN_PRINCIPAL, 'Error resolving principal')) + stat = utils.error_status_factory((samlp.STATUS_UNKNOWN_PRINCIPAL, + 'Error resolving principal')) status_text = "%s" % stat - assert status_text == ERROR_STATUS + assert status_text in (ERROR_STATUS_NO_HEADER, ERROR_STATUS) def test_status_from_tuple_empty_message(): stat = utils.error_status_factory((samlp.STATUS_UNKNOWN_PRINCIPAL, None)) status_text = "%s" % stat - assert status_text == ERROR_STATUS_EMPTY + assert status_text == ERROR_STATUS_NO_HEADER_EMPTY def test_attribute_sn(): diff --git a/tests/test_44_authnresp.py b/tests/test_44_authnresp.py index b22ba6e..5181c41 100644 --- a/tests/test_44_authnresp.py +++ b/tests/test_44_authnresp.py @@ -125,7 +125,7 @@ class TestAuthnResponse: assert len(authn_info) == 1 assert authn_info[0][0] == INTERNETPROTOCOLPASSWORD assert authn_info[0][1] == ["http://www.example.com/login"] - now = datetime.now() + now = datetime.utcnow() dt = parser.parse(authn_info[0][2]) assert now.year == dt.year and now.month == dt.month and now.day == dt.day session_info = self.ar.session_info()