Extend test_send_webhook() to check for inclusion of request path

This commit is contained in:
Jeremy Stretch
2026-03-20 15:17:16 -04:00
parent 6210ded1ea
commit 9eaa754889
+3 -1
View File
@@ -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