From a9b9b27a0b2be5ffdef52b203cdabd3d670fc85d Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Thu, 10 May 2018 12:57:54 -0700 Subject: [PATCH] fix tests --- lemur/certificates/schemas.py | 2 +- lemur/plugins/lemur_acme/tests/test_acme.py | 10 +++++----- lemur/tests/test_certificates.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index 89d51034..c50ddfcb 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -69,7 +69,7 @@ class CertificateInputSchema(CertificateCreationSchema): replaces = fields.Nested(AssociatedCertificateSchema, missing=[], many=True) replacements = fields.Nested(AssociatedCertificateSchema, missing=[], many=True) # deprecated roles = fields.Nested(AssociatedRoleSchema, missing=[], many=True) - dns_provider = fields.Nested(AssociatedDnsProviderSchema, required=False) + dns_provider = fields.Nested(AssociatedDnsProviderSchema, missing=None, allow_none=True, required=False) csr = fields.String(validate=validators.csr) diff --git a/lemur/plugins/lemur_acme/tests/test_acme.py b/lemur/plugins/lemur_acme/tests/test_acme.py index 58e3a24a..80d6c860 100644 --- a/lemur/plugins/lemur_acme/tests/test_acme.py +++ b/lemur/plugins/lemur_acme/tests/test_acme.py @@ -260,11 +260,6 @@ class TestAcme(unittest.TestCase): mock_current_app, mock_dns_provider_service, mock_acme): provider = plugin.ACMEIssuerPlugin() mock_authority = Mock() - issuer_options = { - 'authority': mock_authority, - 'dns_provider': {"id": 1}, - "common_name": "test.netflix.net" - } mock_client = Mock() mock_acme.return_value = (mock_client, "") @@ -274,6 +269,11 @@ class TestAcme(unittest.TestCase): mock_dns_provider.provider_type = "route53" mock_dns_provider_service.get.return_value = mock_dns_provider + issuer_options = { + 'authority': mock_authority, + 'dns_provider': mock_dns_provider, + "common_name": "test.netflix.net" + } csr = "123" mock_request_certificate.return_value = ("pem_certificate", "chain") result = provider.create_certificate(csr, issuer_options) diff --git a/lemur/tests/test_certificates.py b/lemur/tests/test_certificates.py index 23c0e2e1..98283a9d 100644 --- a/lemur/tests/test_certificates.py +++ b/lemur/tests/test_certificates.py @@ -63,7 +63,7 @@ def test_get_certificate_primitives(certificate): with freeze_time(datetime.date(year=2016, month=10, day=30)): primitives = get_certificate_primitives(certificate) - assert len(primitives) == 25 + assert len(primitives) == 24 def test_certificate_edit_schema(session):