@mock.patch('airflow.www.security.AirflowSecurityManager.get_user_roles')
def test_get_all_permissions_views(self, mock_get_user_roles):
    role_name = 'MyRole5'
    role_perm = 'can_some_action'
    role_vm = 'SomeBaseView'
    username = 'get_all_permissions_views'
    with self.app.app_context():
        user = fab_utils.create_user(self.app, username, role_name, permissions=[(role_perm, role_vm)])
        role = user.roles[0]
        mock_get_user_roles.return_value = [role]
        self.assertEqual(self.security_manager.get_all_permissions_views(), {(role_perm, role_vm)})
        mock_get_user_roles.return_value = []
        self.assertEqual(len(self.security_manager.get_all_permissions_views()), 0)
@mock.patch('airflow.www.security.AirflowSecurityManager.get_user_roles')
def test_get_all_permissions_views(self, mock_get_user_roles):
    role_name = 'MyRole5'
    role_perm = 'can_some_action'
    role_vm = 'SomeBaseView'
    username = 'get_all_permissions_views'
    with self.app.app_context():
        user = fab_utils.create_user(self.app, username, role_name, permissions=[(role_perm, role_vm)])
        role = user.roles[0]
        mock_get_user_roles.return_value = [role]
        self.assertEqual(self.security_manager.get_all_permissions_views(), {(role_perm, role_vm)})
        mock_get_user_roles.return_value = []
        self.assertEqual(len(self.security_manager.get_all_permissions_views()), 0)