我需要检查是否在方法调用delete()的实例中调用了特定的函数“oscp.deactivate_user()”
到目前为止,这是我所拥有的,断言失败,当它不应该。
@mock.patch.object(AuthUser, 'delete')
@mock.patch('oscp.deactivate_user')
def test_delete(self, deactivate_user_mock, delete_mock):
"""Test the delete() method in AuthUser"""
authUserObject = mock.Mock()
authUserObject.oscp_id = 4
"""If delete_from_oscp = True && oscp_id isset"""
delete_mock_instance = delete_mock(self, True, authUserObject, oscp_id=4)
delete_mock_instance.delete_mock.assert_called_once_with(self)