Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit c7b4e76f authored by Vincent SIMONIN's avatar Vincent SIMONIN
Browse files

:twisted_rightwards_arrows: Merge branch 'certificate_state_update' into 'main'

:boom: Change certificate state values

See merge request !54
parents 14befd5a a3f98b92
No related branches found
No related tags found
1 merge request!54💥 Change certificate state values
Pipeline #117128 passed
"""Migration File"""
# pylint: disable=C0103
from django.db import migrations, models
class Migration(migrations.Migration):
"""Migration Class"""
dependencies = [
(
"netbox_cert_plugin",
"0003_alter_certificate_options_certificate_state_and_more",
),
]
operations = [
migrations.AlterField(
model_name="certificate",
name="state",
field=models.CharField(default="to_be_created", max_length=32),
),
]
......@@ -42,12 +42,15 @@ class StateChoices(ChoiceSet):
key = "Certificate.state"
DEFAULT_VALUE = "pending"
DEFAULT_VALUE = "to_be_created"
CHOICES = [
("pending", "Pending", "yellow"),
("valid", "Valid", "green"),
("to_be_renewed", "To be renewed", "blue"),
("to_be_created", "To be created", "yellow"),
("creating", "Creating", "green"),
("errored", "Errored", "red"),
("valid", "Valid", "blue"),
("to_be_renewed", "To be renewed", "black"),
("renewing", "Renewing", "green"),
]
......
"""Test case for Mapping creation"""
"""Test case for Certificate creation"""
import time
import unittest
......@@ -47,7 +47,7 @@ class TestCertificateCreation(unittest.TestCase):
content = json.loads(response.content)
self.assertEqual(content["expiration_time"], "1m")
self.assertEqual(content["state"], "pending")
self.assertEqual(content["state"], "to_be_created")
def test_that_cn_is_unique(self) -> None:
"""Test that CN is unique"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment