mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 13:38:16 -06:00
14132 fix api tests
This commit is contained in:
parent
6549dce758
commit
3e4821e5be
@ -211,16 +211,26 @@ class EventRuleTestCase(TestCase, BaseFilterSetTests):
|
|||||||
def setUpTestData(cls):
|
def setUpTestData(cls):
|
||||||
content_types = ContentType.objects.filter(model__in=['region', 'site', 'rack', 'location', 'device'])
|
content_types = ContentType.objects.filter(model__in=['region', 'site', 'rack', 'location', 'device'])
|
||||||
|
|
||||||
|
webhooks = (
|
||||||
|
Webhook(
|
||||||
|
name='Webhook 1',
|
||||||
|
payload_url='http://example.com/?1',
|
||||||
|
),
|
||||||
|
Webhook(
|
||||||
|
name='Webhook 2',
|
||||||
|
payload_url='http://example.com/?1',
|
||||||
|
),
|
||||||
|
Webhook(
|
||||||
|
name='Webhook 3',
|
||||||
|
payload_url='http://example.com/?1',
|
||||||
|
),
|
||||||
|
)
|
||||||
|
Webhook.objects.bulk_create(webhooks)
|
||||||
|
|
||||||
event_rules = (
|
event_rules = (
|
||||||
EventRule(
|
EventRule(name='EventRule 1', action_object=webhooks[0]),
|
||||||
name='EventRule 1',
|
EventRule(name='EventRule 2', action_object=webhooks[1]),
|
||||||
),
|
EventRule(name='EventRule 3', action_object=webhooks[2]),
|
||||||
EventRule(
|
|
||||||
name='EventRule 2',
|
|
||||||
),
|
|
||||||
EventRule(
|
|
||||||
name='EventRule 3',
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
EventRule.objects.bulk_create(event_rules)
|
EventRule.objects.bulk_create(event_rules)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user