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>
25 lines
630 B
Python
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
|