From 957f29febdca771725f5c41e9416aea7e2597833 Mon Sep 17 00:00:00 2001 From: Mathias Ertl Date: Sat, 9 Mar 2024 23:00:18 +0100 Subject: [PATCH] freeze time to make tests more predictable --- ca/django_ca/tests/commands/test_view_ca.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ca/django_ca/tests/commands/test_view_ca.py b/ca/django_ca/tests/commands/test_view_ca.py index 556cb34b6..03a1f083d 100644 --- a/ca/django_ca/tests/commands/test_view_ca.py +++ b/ca/django_ca/tests/commands/test_view_ca.py @@ -21,6 +21,9 @@ from django.conf import settings from django.test import TestCase +from freezegun import freeze_time + +from django_ca.tests.base.constants import TIMESTAMPS from django_ca.tests.base.mixins import TestCaseMixin from django_ca.tests.base.utils import cmd, issuer_alternative_name, override_tmpcadir, uri from django_ca.utils import format_general_name @@ -1091,7 +1094,7 @@ * commonName (CN): GlobalSign Root CA * Valid from: {valid_from_str} * Valid until: {valid_until_str} -* Status: Expired +* Status: Valid Certificate Authority information: * Certificate authority is a root CA. @@ -1696,6 +1699,7 @@ expected["pwd"] = expected["ec"] +@freeze_time(TIMESTAMPS["everything_valid"]) class ViewCATestCase(TestCaseMixin, TestCase): """Main test class for this command."""