Merge branch 'master' into unittests-use-valid-certs
This commit is contained in:
@ -25,6 +25,7 @@ LEMUR_ENCRYPTION_KEYS = 'o61sBLNBSGtAckngtNrfVNd8xy8Hp9LBGDstTbMbqCY='
|
||||
LEMUR_WHITELISTED_DOMAINS = [
|
||||
'^[a-zA-Z0-9-]+\.example\.com$',
|
||||
'^[a-zA-Z0-9-]+\.example\.org$',
|
||||
'^example\d+\.long\.com$',
|
||||
]
|
||||
|
||||
# Mail Server
|
||||
|
@ -32,6 +32,16 @@ class BaseFactory(SQLAlchemyModelFactory):
|
||||
sqlalchemy_session = db.session
|
||||
|
||||
|
||||
class RotationPolicyFactory(BaseFactory):
|
||||
"""Rotation Factory."""
|
||||
name = Sequence(lambda n: 'policy{0}'.format(n))
|
||||
days = 30
|
||||
|
||||
class Meta:
|
||||
"""Factory configuration."""
|
||||
model = RotationPolicy
|
||||
|
||||
|
||||
class CertificateFactory(BaseFactory):
|
||||
"""Certificate factory."""
|
||||
name = Sequence(lambda n: 'certificate{0}'.format(n))
|
||||
@ -44,6 +54,7 @@ class CertificateFactory(BaseFactory):
|
||||
description = FuzzyText(length=128)
|
||||
active = True
|
||||
date_created = FuzzyDate(date(2016, 1, 1), date(2020, 1, 1))
|
||||
rotation_policy = SubFactory(RotationPolicyFactory)
|
||||
|
||||
class Meta:
|
||||
"""Factory Configuration."""
|
||||
@ -157,16 +168,6 @@ class AsyncAuthorityFactory(AuthorityFactory):
|
||||
authority_certificate = SubFactory(CertificateFactory)
|
||||
|
||||
|
||||
class RotationPolicyFactory(BaseFactory):
|
||||
"""Rotation Factory."""
|
||||
name = Sequence(lambda n: 'policy{0}'.format(n))
|
||||
days = 30
|
||||
|
||||
class Meta:
|
||||
"""Factory configuration."""
|
||||
model = RotationPolicy
|
||||
|
||||
|
||||
class DestinationFactory(BaseFactory):
|
||||
"""Destination factory."""
|
||||
plugin_name = 'test-destination'
|
||||
|
@ -48,7 +48,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) == 24
|
||||
assert len(primitives) == 25
|
||||
|
||||
|
||||
def test_certificate_output_schema(session, certificate, issuer_plugin):
|
||||
|
Reference in New Issue
Block a user