From 2a971c7ec8a0a2417e0873086dcf02a612825097 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 18 Apr 2017 11:46:22 +0200 Subject: [PATCH] [FIX] various improvement. Courtesy @dreispt review --- sql_export/demo/sql_export.xml | 2 +- sql_export/tests/test_sql_query.py | 27 ++++++--------------------- sql_export/views/sql_export_view.xml | 4 ++-- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/sql_export/demo/sql_export.xml b/sql_export/demo/sql_export.xml index 70499c9f8..4e168a505 100644 --- a/sql_export/demo/sql_export.xml +++ b/sql_export/demo/sql_export.xml @@ -12,6 +12,6 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). SELECT name, street FROM res_partner; - + diff --git a/sql_export/tests/test_sql_query.py b/sql_export/tests/test_sql_query.py index f1e516dc4..ffcd4d2ad 100644 --- a/sql_export/tests/test_sql_query.py +++ b/sql_export/tests/test_sql_query.py @@ -1,23 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Florian da Costa -# Copyright 2015 Akretion -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distnaributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright (C) 2015 Akretion () +# @author: Florian da Costa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + import base64 from openerp.tests.common import TransactionCase from openerp.exceptions import Warning as UserError @@ -56,7 +41,7 @@ class TestExportSqlQuery(TransactionCase): sql_export = self.sql_export_obj.create({ 'name': 'test_prohibited', 'query': query}) - sql_export.button_clean_check_request() + sql_export.button_validate_sql_expression() def test_authorized_queries(self): authorized_queries = [ @@ -67,7 +52,7 @@ class TestExportSqlQuery(TransactionCase): sql_export = self.sql_export_obj.create({ 'name': 'test_authorized', 'query': query}) - sql_export.button_clean_check_request() + sql_export.button_validate_sql_expression() self.assertEqual( sql_export.state, 'sql_valid', "%s is a valid request" % (query)) diff --git a/sql_export/views/sql_export_view.xml b/sql_export/views/sql_export_view.xml index 2df21f33e..3fb33f9fb 100644 --- a/sql_export/views/sql_export_view.xml +++ b/sql_export/views/sql_export_view.xml @@ -10,8 +10,8 @@
-