|
11 | 11 | import requests |
12 | 12 | from freezegun import freeze_time |
13 | 13 | from requests import codes |
| 14 | +from requests.structures import CaseInsensitiveDict |
14 | 15 |
|
15 | 16 | from mock_vws._constants import ResultCodes |
16 | 17 | from tests.mock_vws.utils import Endpoint |
@@ -62,10 +63,7 @@ def test_no_date_header( |
62 | 63 | 'Authorization': authorization_string, |
63 | 64 | } |
64 | 65 | headers.pop('Date', None) |
65 | | - |
66 | | - endpoint.prepared_request.prepare_headers( # type: ignore |
67 | | - headers=headers, |
68 | | - ) |
| 66 | + endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers) |
69 | 67 | session = requests.Session() |
70 | 68 | response = session.send( # type: ignore |
71 | 69 | request=endpoint.prepared_request, |
@@ -135,9 +133,7 @@ def test_incorrect_date_format( |
135 | 133 | 'Date': date_incorrect_format, |
136 | 134 | } |
137 | 135 |
|
138 | | - endpoint.prepared_request.prepare_headers( # type: ignore |
139 | | - headers=headers, |
140 | | - ) |
| 136 | + endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers) |
141 | 137 | session = requests.Session() |
142 | 138 | response = session.send( # type: ignore |
143 | 139 | request=endpoint.prepared_request, |
@@ -218,9 +214,7 @@ def test_date_out_of_range( |
218 | 214 | 'Date': date, |
219 | 215 | } |
220 | 216 |
|
221 | | - endpoint.prepared_request.prepare_headers( # type: ignore |
222 | | - headers=headers, |
223 | | - ) |
| 217 | + endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers) |
224 | 218 | session = requests.Session() |
225 | 219 | response = session.send( # type: ignore |
226 | 220 | request=endpoint.prepared_request, |
@@ -282,9 +276,7 @@ def test_date_in_range( |
282 | 276 | 'Date': date, |
283 | 277 | } |
284 | 278 |
|
285 | | - endpoint.prepared_request.prepare_headers( # type: ignore |
286 | | - headers=headers, |
287 | | - ) |
| 279 | + endpoint.prepared_request.headers = CaseInsensitiveDict(data=headers) |
288 | 280 | session = requests.Session() |
289 | 281 | response = session.send( # type: ignore |
290 | 282 | request=endpoint.prepared_request, |
|
0 commit comments