Skip to content

Commit

Permalink
testcase to test unicode in db result
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand committed Nov 27, 2008
1 parent 3bd830e commit 18b6b3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions test/db.py
Expand Up @@ -87,6 +87,12 @@ def test_multiple_insert(self):
assert db.select("person", where="name='a'")
assert db.select("person", where="name='b'")

def testUnicode(self):
db = webtest.setup_database(self.dbname)
self.db.insert('person', False, name='user')
name = db.select('person')[0].name
self.assertEquals(type(name), unicode)

class SqliteTest(DBTest):
dbname = "sqlite"

Expand Down
2 changes: 1 addition & 1 deletion web/db.py
Expand Up @@ -419,7 +419,7 @@ def __init__(self, db_module, keywords):
self.has_pooling = False

# Pooling can be disabled by passing pooling=False in the keywords.
self.has_pooling = self.has_pooling and self.keywords.pop('pooling', True)
self.has_pooling = self.keywords.pop('pooling', True) and self.has_pooling

def _getctx(self):
if not self._ctx.get('db'):
Expand Down

0 comments on commit 18b6b3f

Please sign in to comment.