Use app_info_text in EveSwaggerProvider to set the User-Agent header on ESI requests.

This commit is contained in:
colcrunch
2020-12-01 22:40:09 -05:00
parent bfcdfea6c8
commit 75de4518f2
2 changed files with 13 additions and 2 deletions

View File

@@ -592,3 +592,12 @@ class TestEveSwaggerProvider(TestCase):
self.assertTrue(mock_esi_client_factory.called)
self.assertIsNotNone(my_provider._client)
self.assertEqual(my_client, 'my_client')
@patch(MODULE_PATH + '.__version__', '1.0.0')
def test_user_agent_header(self):
my_provider = EveSwaggerProvider()
my_client = my_provider.client
operation = my_client.Status.get_status()
self.assertEqual(
operation.future.request.headers['User-Agent'], 'allianceauth v1.0.0'
)