--- a/server/sources/rql2sql.py Wed Jul 27 16:44:02 2011 +0200
+++ b/server/sources/rql2sql.py Wed Jul 27 18:08:39 2011 +0200
@@ -1494,8 +1494,6 @@
self._query_attrs[_id] = utcdatetime(value)
elif isinstance(value, time) and value.tzinfo is not None:
self._query_attrs[_id] = utctime(value)
- elif isinstance(value, bool):
- return self.dbhelper.boolean_value(value)
else:
_id = str(id(constant)).replace('-', '', 1)
self._query_attrs[_id] = value
--- a/server/test/unittest_querier.py Wed Jul 27 16:44:02 2011 +0200
+++ b/server/test/unittest_querier.py Wed Jul 27 18:08:39 2011 +0200
@@ -800,6 +800,12 @@
'Password', 'String',
'TZDatetime', 'TZTime',
'Time'])
+ req = self.session
+ req.create_entity('Personne', nom=u'louis', test=True)
+ self.assertEqual(len(req.execute('Any X WHERE X test %(val)s', {'val': True})), 1)
+ self.assertEqual(len(req.execute('Any X WHERE X test TRUE')), 1)
+ self.assertEqual(len(req.execute('Any X WHERE X test %(val)s', {'val': False})), 0)
+ self.assertEqual(len(req.execute('Any X WHERE X test FALSE')), 0)
def test_select_constant(self):
rset = self.execute('Any X, "toto" ORDERBY X WHERE X is CWGroup')
--- a/server/test/unittest_repository.py Wed Jul 27 16:44:02 2011 +0200
+++ b/server/test/unittest_repository.py Wed Jul 27 18:08:39 2011 +0200
@@ -68,7 +68,7 @@
namecol, table, finalcol))
self.assertEqual(cu.fetchall(), [])
cu = self.session.system_sql('SELECT %s FROM %s WHERE %s=%%(final)s ORDER BY %s'
- % (namecol, table, finalcol, namecol), {'final': 'TRUE'})
+ % (namecol, table, finalcol, namecol), {'final': True})
self.assertEqual(cu.fetchall(), [(u'BigInt',), (u'Boolean',), (u'Bytes',),
(u'Date',), (u'Datetime',),
(u'Decimal',),(u'Float',),