Fix tests for #4502

This commit is contained in:
Jeremy Stretch 2020-04-30 15:43:33 -04:00
parent 05cb47e650
commit 6ab046ba8f
2 changed files with 8 additions and 4 deletions

View File

@ -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.

View File

@ -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