# -*- coding: utf-8 -*-
-# Run with one of these commands:
-# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
-# OPENERP_DATABASE=yy PYTHONPATH=. python tests/test_ir_sequence.py
-# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
-# OPENERP_DATABASE=yy nosetests tests/test_ir_sequence.py
-# > OPENERP_ADDONS_PATH='../../../addons/trunk' OPENERP_PORT=8069 \
-# OPENERP_DATABASE=yy PYTHONPATH=../:. unit2 test_ir_sequence
-# This assume an existing database.
import unittest2
import openerp
+from openerp.tools.misc import mute_logger
import common
DB = common.DB
return openerp.modules.registry.RegistryManager.get(DB).db.cursor()
-class test_ir_sequence_standard(unittest2.TestCase):
+class test_cr_execute(unittest2.TestCase):
""" Try cr.execute with wrong parameters """
+ @mute_logger('openerp.sql_db')
def test_execute_bad_params(self):
- """ Try to use non-iterable in query parameters. """
+ """
+ Try to use iterable but non-list or int params in query parameters.
+ """
cr = cursor()
with self.assertRaises(ValueError):
cr.execute("SELECT id FROM res_users WHERE login=%s", 'admin')