Skip to content

Commit

Permalink
fix: Webhook integration not rebuilding environment (#4641)
Browse files Browse the repository at this point in the history
  • Loading branch information
khvn26 authored Sep 20, 2024
1 parent 1237c06 commit 37db0e0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/integrations/webhook/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class WebhookConfiguration(
AbstractBaseSoftDeleteExportableWebhookModel, LifecycleModelMixin
LifecycleModelMixin, AbstractBaseSoftDeleteExportableWebhookModel
):
environment = models.OneToOneField(
Environment, related_name="webhook_config", on_delete=models.CASCADE
Expand Down
19 changes: 19 additions & 0 deletions api/tests/unit/integrations/webhook/test_unit_webhook_models.py
Original file line number Diff line number Diff line change
@@ -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
)

0 comments on commit 37db0e0

Please sign in to comment.