From 90839b4d4b1b467409fb84827ab957bd039578e4 Mon Sep 17 00:00:00 2001 From: sayali Date: Wed, 14 Oct 2020 14:48:54 -0700 Subject: [PATCH] Unit test for cab_compliant = true --- lemur/tests/test_certificates.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lemur/tests/test_certificates.py b/lemur/tests/test_certificates.py index c0f59f2f..fbe24e26 100644 --- a/lemur/tests/test_certificates.py +++ b/lemur/tests/test_certificates.py @@ -196,6 +196,16 @@ def test_certificate_output_schema_subject_details(session, certificate, issuer_ assert data["organization"] == "Daniel San & co" assert data["organizationalUnit"] == "Karate Lessons" + # Mark authority as cab-compliant + update_options(certificate.authority.id, '[{"name": "cab_compliant","value":true}]') + data, errors = CertificateOutputSchema().dump(certificate) + assert not errors + assert "country" not in data + assert "state" not in data + assert "location" not in data + assert "organization" not in data + assert "organizationalUnit" not in data + def test_certificate_edit_schema(session): from lemur.certificates.schemas import CertificateEditInputSchema