oncall-engine/engine/apps/webhooks/tests/factories.py
Matias Bordese 576fecf6d3
feat: add personal webhook notification backend (#5426)
Related to https://github.com/grafana/irm/issues/332

(see https://github.com/grafana/oncall/pull/5440 and
https://github.com/grafana/oncall/pull/5446 for the related UI changes)

---------

Co-authored-by: Matt Thorning <matt.thorning@grafana.com>
2025-02-18 17:53:07 +00:00

25 lines
630 B
Python

import factory
import pytz
from apps.webhooks.models import PersonalNotificationWebhook, Webhook, WebhookResponse
from common.utils import UniqueFaker
class CustomWebhookFactory(factory.DjangoModelFactory):
url = factory.Faker("url")
name = UniqueFaker("sentence", nb_words=3)
class Meta:
model = Webhook
class PersonalNotificationWebhookFactory(factory.DjangoModelFactory):
class Meta:
model = PersonalNotificationWebhook
class WebhookResponseFactory(factory.DjangoModelFactory):
timestamp = factory.Faker("date_time", tzinfo=pytz.UTC)
class Meta:
model = WebhookResponse