diff --git a/api/integrations/webhook/models.py b/api/integrations/webhook/models.py index 7741aa215e6e..ab2a8cb7590b 100644 --- a/api/integrations/webhook/models.py +++ b/api/integrations/webhook/models.py @@ -11,7 +11,7 @@ class WebhookConfiguration( - AbstractBaseSoftDeleteExportableWebhookModel, LifecycleModelMixin + LifecycleModelMixin, AbstractBaseSoftDeleteExportableWebhookModel ): environment = models.OneToOneField( Environment, related_name="webhook_config", on_delete=models.CASCADE diff --git a/api/tests/unit/integrations/webhook/test_unit_webhook_models.py b/api/tests/unit/integrations/webhook/test_unit_webhook_models.py new file mode 100644 index 000000000000..51ac8192646c --- /dev/null +++ b/api/tests/unit/integrations/webhook/test_unit_webhook_models.py @@ -0,0 +1,19 @@ +from pytest_mock import MockerFixture + +from environments.models import Environment +from integrations.webhook.models import WebhookConfiguration + + +def test_webhook_model__save__call_expected( + environment: Environment, mocker: MockerFixture +) -> None: + # Given + environment_mock = mocker.patch("integrations.webhook.models.Environment") + + # When + WebhookConfiguration.objects.create(environment=environment) + + # Then + environment_mock.write_environments_to_dynamodb.assert_called_with( + environment_id=environment.id + )