From 5544bca8ea48f77e9ac3a76d84f194e0ec24b883 Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Mon, 17 Feb 2020 15:00:38 -0600 Subject: [PATCH] Check if content-type contains http, not equals This change modifies the unit test for checking if the response is an html error. Rather than checking for equality, just check that the content type contains text/html. Change-Id: I6953f2404f79d004939d4a4fcd114f11bd83b773 --- keystone/tests/unit/server/test_keystone_flask.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keystone/tests/unit/server/test_keystone_flask.py b/keystone/tests/unit/server/test_keystone_flask.py index f916fccef8..644e6fa2c7 100644 --- a/keystone/tests/unit/server/test_keystone_flask.py +++ b/keystone/tests/unit/server/test_keystone_flask.py @@ -775,6 +775,6 @@ class TestKeystoneFlaskUnrouted404(rest.RestfulTestCase): path = '/{unrouted_path}'.format(unrouted_path=uuid.uuid4()) resp = c.get(path, expected_status_code=404) # Make sure we're emitting a html error - self.assertEqual('text/html', resp.headers['Content-Type']) + self.assertIn('text/html', resp.headers['Content-Type']) # Ensure the more generic flask/werkzeug 404 response is emitted self.assertTrue(b'404 Not Found' in resp.data)