Jeremy Stretch 5 роки тому
батько
коміт
6ab046ba8f

+ 1 - 1
netbox/extras/tests/test_webhooks.py

@@ -102,7 +102,7 @@ class WebhookTest(APITestCase):
 
         request_id = uuid.uuid4()
 
-        def dummy_send(_, request):
+        def dummy_send(_, request, **kwargs):
             """
             A dummy implementation of Session.send() to be used for testing.
             Always returns a 200 HTTP response.

+ 7 - 3
netbox/netbox/tests/test_releases.py

@@ -4,6 +4,7 @@ from unittest.mock import Mock, patch
 
 import requests
 from cacheops import CacheMiss, RedisCache
+from django.conf import settings
 from django.test import SimpleTestCase, override_settings
 from packaging.version import Version
 from requests import Response
@@ -77,7 +78,8 @@ class GetReleasesTestCase(SimpleTestCase):
         # Check if correct request is made
         dummy_request_get.assert_called_once_with(
             'https://localhost/unittest/releases',
-            headers={'Accept': 'application/vnd.github.v3+json'}
+            headers={'Accept': 'application/vnd.github.v3+json'},
+            proxies=settings.HTTP_PROXIES
         )
 
         # Check if result is put in cache
@@ -105,7 +107,8 @@ class GetReleasesTestCase(SimpleTestCase):
         # Check if correct request is made
         dummy_request_get.assert_called_once_with(
             'https://localhost/unittest/releases',
-            headers={'Accept': 'application/vnd.github.v3+json'}
+            headers={'Accept': 'application/vnd.github.v3+json'},
+            proxies=settings.HTTP_PROXIES
         )
 
         # Check if result is put in cache
@@ -137,7 +140,8 @@ class GetReleasesTestCase(SimpleTestCase):
         # Check if correct request is made
         dummy_request_get.assert_called_once_with(
             'https://localhost/unittest/releases',
-            headers={'Accept': 'application/vnd.github.v3+json'}
+            headers={'Accept': 'application/vnd.github.v3+json'},
+            proxies=settings.HTTP_PROXIES
         )
 
         # Check if failure is put in cache