Fix Unsupported Language Test

Unit test [0] tries to assert that 'None' is returned when
'Accept-Language' in request contains an unsupported language.
To test that, we used 'zh' as the test language. However, 'zh'
is a supported language and due to some missing functionality
in oslo.i18n, it didn't show up as a valid locale.

I00601dec28adbef05e9ab0ebb6d291d0eee8becb fixes the issue in
oslo.i18n and now returns 'zh' locales as well. Hence, our test
fails. So, stop using 'zh' to test unsupported language.

[0] glance.tests.unit.common.test_wsgi.RequestTest.test_request_match_language_unexpected

Change-Id: I87b38ee9a3b46a117b2cdbcb8d00f3a87e9af111
This commit is contained in:
Hemanth Makkapati 2017-03-15 17:27:29 -05:00
parent 7580d817da
commit 21c40d717a
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ class RequestTest(test_utils.BaseTestCase):
# best_match_language() returns None.
self._set_expected_languages(all_locales=['it'])
req = wsgi.Request.blank('/', headers={'Accept-Language': 'zh'})
req = wsgi.Request.blank('/', headers={'Accept-Language': 'unknown'})
self.assertIsNone(req.best_match_language())
@mock.patch.object(webob.acceptparse.AcceptLanguage, 'best_match')