diff --git a/openstack_dashboard/test/api_tests/keystone_rest_tests.py b/openstack_dashboard/test/api_tests/keystone_rest_tests.py index 789fa80d67..ff6c38ea4d 100644 --- a/openstack_dashboard/test/api_tests/keystone_rest_tests.py +++ b/openstack_dashboard/test/api_tests/keystone_rest_tests.py @@ -42,7 +42,6 @@ class KeystoneRestTestCase(test.TestCase): self.assertStatusCode(response, 200) self.assertEqual(response.content, '{"name": "Ni!"}') kc.user_get.assert_called_once_with(request, 'current_id') - kc.user_get.assert_not_called() @mock.patch.object(keystone.api, 'keystone') def test_user_get_list(self, kc): @@ -151,7 +150,7 @@ class KeystoneRestTestCase(test.TestCase): response = keystone.Users().delete(request) self.assertStatusCode(response, 204) self.assertEqual(response.content, '') - kc.user_delete.assert_has_mock.calls([ + kc.user_delete.assert_has_calls([ mock.call(request, 'id1'), mock.call(request, 'id2'), mock.call(request, 'id3'), @@ -312,7 +311,7 @@ class KeystoneRestTestCase(test.TestCase): response = keystone.Roles().delete(request) self.assertStatusCode(response, 204) self.assertEqual(response.content, '') - kc.role_delete.assert_has_mock.calls([ + kc.role_delete.assert_has_calls([ mock.call(request, 'id1'), mock.call(request, 'id2'), mock.call(request, 'id3'), @@ -418,7 +417,7 @@ class KeystoneRestTestCase(test.TestCase): response = keystone.Domains().delete(request) self.assertStatusCode(response, 204) self.assertEqual(response.content, '') - kc.domain_delete.assert_has_mock.calls([ + kc.domain_delete.assert_has_calls([ mock.call(request, 'id1'), mock.call(request, 'id2'), mock.call(request, 'id3'), @@ -539,7 +538,7 @@ class KeystoneRestTestCase(test.TestCase): response = keystone.Projects().delete(request) self.assertStatusCode(response, 204) self.assertEqual(response.content, '') - kc.tenant_delete.assert_has_mock.calls([ + kc.tenant_delete.assert_has_calls([ mock.call(request, 'id1'), mock.call(request, 'id2'), mock.call(request, 'id3'), diff --git a/openstack_dashboard/test/api_tests/rest_util_tests.py b/openstack_dashboard/test/api_tests/rest_util_tests.py index 6fe1a68f39..fc72ff929d 100644 --- a/openstack_dashboard/test/api_tests/rest_util_tests.py +++ b/openstack_dashboard/test/api_tests/rest_util_tests.py @@ -22,7 +22,7 @@ class RestUtilsTestCase(test.TestCase): return 'ok' request = self.mock_rest_request() response = f(None, request) - request.is_authenticated.assert_called_once() + request.user.is_authenticated.assert_called_once_with() self.assertStatusCode(response, 200) self.assertEqual(response.content, '"ok"') @@ -32,7 +32,7 @@ class RestUtilsTestCase(test.TestCase): return 'ok' request = self.mock_rest_request() response = f(None, request) - request.is_authenticated.assert_not_called_once() + request.user.is_authenticated.assert_not_called() self.assertStatusCode(response, 200) self.assertEqual(response.content, '"ok"') @@ -44,7 +44,7 @@ class RestUtilsTestCase(test.TestCase): 'user.is_authenticated.return_value': False }) response = f(None, request) - request.is_authenticated.assert_called_once() + request.user.is_authenticated.assert_called_once_with() self.assertStatusCode(response, 401) self.assertEqual(response.content, '"not logged in"') @@ -111,7 +111,7 @@ class RestUtilsTestCase(test.TestCase): return utils.CreatedResponse('/api/spam/spam123') request = self.mock_rest_request() response = f(None, request) - request.is_authenticated.assert_called_once() + request.user.is_authenticated.assert_called_once_with() self.assertStatusCode(response, 201) self.assertEqual(response['location'], '/api/spam/spam123') self.assertEqual(response.content, '') @@ -122,7 +122,7 @@ class RestUtilsTestCase(test.TestCase): return utils.CreatedResponse('/api/spam/spam123', 'spam!') request = self.mock_rest_request() response = f(None, request) - request.is_authenticated.assert_called_once() + request.user.is_authenticated.assert_called_once_with() self.assertStatusCode(response, 201) self.assertEqual(response['location'], '/api/spam/spam123') self.assertEqual(response.content, '"spam!"')