oncall-engine/engine/apps/webhooks/tests/factories.py
Matias Bordese d40d3a62b8
Keep webhook responses data (#1580)
Track all webhook responses data, and allow using this between
alertgroup-related webhooks (e.g. use firing webhook response data when
templating the acknowledge webhook request data).

NOTE: dropping the table is not backwards compatible but the feature is
not enabled (and in any case it would drop log entries only used for
status display)
2023-03-21 13:43:37 +00:00

20 lines
425 B
Python

import factory
from apps.webhooks.models import Webhook, WebhookResponse
from common.utils import UniqueFaker
class CustomWebhookFactory(factory.DjangoModelFactory):
url = factory.Faker("url")
name = UniqueFaker("word")
class Meta:
model = Webhook
class WebhookResponseFactory(factory.DjangoModelFactory):
timestamp = factory.Faker("date_time")
class Meta:
model = WebhookResponse