Skip to content

Commit

Permalink
Add leap year support
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarnoldus committed Apr 20, 2023
1 parent f5b6399 commit 6282433
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/tests/api/test_certificates.py
Expand Up @@ -125,6 +125,10 @@ def test_retrieve_certificates(self):
result = response.json()
self.assertEqual(result["count"], 7)
for i in range(4):
# support for leap year
if result["results"][3 - i]["days_valid"] == 366:
result["results"][3 - i]["days_valid"] = 365

self.assertDictEqual(
result["results"][3 - i],
{
Expand Down Expand Up @@ -243,6 +247,9 @@ def test_create_server_certificate(self):
self.assertIsNotNone(result.pop("keystore"))
self.assertIsNotNone(result.pop("serial"))

# support for leap year
if result["days_valid"] == 366:
result["days_valid"] = 365
self.assertDictEqual(
result,
{
Expand Down

0 comments on commit 6282433

Please sign in to comment.