diff --git a/src/spid_sp_test/metadata_extra.py b/src/spid_sp_test/metadata_extra.py index 13c6d12..c4d57ba 100644 --- a/src/spid_sp_test/metadata_extra.py +++ b/src/spid_sp_test/metadata_extra.py @@ -105,10 +105,12 @@ def test_Signature_extra(self): self._assertTrue( ( - datetime.datetime.strptime(sign_cert[3], "%b %d %H:%M:%S %Y") - >= datetime.datetime.now() + datetime.datetime != "" and ( + datetime.datetime.strptime(sign_cert[3], "%b %d %H:%M:%S %Y") + >= datetime.datetime.now() + ) ), - f"The certificate #{i} is expired. It was valid till {sign_cert[3]}", + f"The certificate #{i} is expired or datetime is not valid. It was valid till {sign_cert[3]}", **_data, ) os.remove(fname)