mirror of
https://github.com/netbox-community/netbox.git
synced 2026-03-21 12:08:38 -06:00
Extend test_send_webhook() to check for inclusion of request path
This commit is contained in:
@@ -345,6 +345,7 @@ class EventRuleTest(APITestCase):
|
||||
|
||||
def test_send_webhook(self):
|
||||
request_id = uuid.uuid4()
|
||||
url_path = reverse('dcim:site_add')
|
||||
|
||||
def dummy_send(_, request, **kwargs):
|
||||
"""
|
||||
@@ -372,12 +373,13 @@ class EventRuleTest(APITestCase):
|
||||
self.assertEqual(body['context']['foo'], 123) # From netbox.tests.dummy_plugin
|
||||
self.assertEqual(body['request']['id'], str(request_id))
|
||||
self.assertEqual(body['request']['method'], 'GET')
|
||||
self.assertEqual(body['request']['path'], url_path)
|
||||
self.assertEqual(body['request']['user'], 'testuser')
|
||||
|
||||
return HttpResponse()
|
||||
|
||||
# Create a dummy request
|
||||
request = RequestFactory().get(reverse('dcim:site_add'))
|
||||
request = RequestFactory().get(url_path)
|
||||
request.id = request_id
|
||||
request.user = self.user
|
||||
|
||||
|
||||
Reference in New Issue
Block a user