Add Fix django.contrib.auth.middleware monkey patching for APITestCase

This patch rollbacks changes in APITestCase introduced in the
0d16361326 commit to unblock Horizon
plugins gates.

Change-Id: I6b2be31568e4aa4273990f9cfa76ca139620c84b
Closes-bug: #1806053
Closes-bug: #1805240
This commit is contained in:
Ivan Kolodyazhny 2018-11-30 17:33:21 +02:00
parent 04a0fdafcc
commit de69edd040

View File

@ -451,11 +451,10 @@ class BaseAdminViewTests(TestCase):
self.client.cookies[settings.SESSION_COOKIE_NAME] = store.session_key
# NOTE(adriant): APITestCase was only needed for some openstack_auth
# monkeypatching. With the new monkeypatch middleware from openstack_auth this
# is not needed.
# TODO(adriant): Clean up APITestCase usage in horizon plugins.
APITestCase = TestCase
class APITestCase(TestCase):
def setUp(self):
super(APITestCase, self).setUp()
utils.patch_middleware_get_user()
# APIMockTestCase was introduced to support mox to mock migration smoothly