Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

with better iterbetter, bool test can be done on sqlite results too

  • Loading branch information...
commit 9e5e40492f6e141df977a93def73423702038bcd 1 parent fa655ca
@anandology anandology authored
Showing with 5 additions and 4 deletions.
  1. +5 −0 test/db.py
  2. +0 −4 web/db.py
View
5 test/db.py
@@ -99,6 +99,11 @@ def test_result_is_unicode(self):
name = db.select('person')[0].name
self.assertEquals(type(name), unicode)
+ def test_result_is_true(self):
+ db = webtest.setup_database(self.dbname)
+ self.db.insert('person', False, name='user')
+ self.assertEquals(bool(db.select('person')), True)
+
def testBoolean(self):
def t(active):
name ='name-%s' % active
View
4 web/db.py
@@ -966,11 +966,7 @@ def _process_insert_query(self, query, tablename, seqname):
def query(self, *a, **kw):
out = DB.query(self, *a, **kw)
if isinstance(out, iterbetter):
- # rowcount is not provided by sqlite
- def _nonzero():
- raise self.db_module.NotSupportedError("rowcount is not supported by sqlite")
del out.__len__
- out.__nonzero__ = _nonzero
return out
class FirebirdDB(DB):
Please sign in to comment.
Something went wrong with that request. Please try again.