Author: novalis
Date: 2007-09-26 13:41:09 -0600 (Wed, 26 Sep 2007)
New Revision: 2996
Added:
SQLObject/trunk/sqlobject/mysql/tests/
SQLObject/trunk/sqlobject/mysql/tests/test_unicode.py
Log:
test for mysql unicode and blobs
Added: SQLObject/trunk/sqlobject/mysql/tests/test_unicode.py
===================================================================
--- SQLObject/trunk/sqlobject/mysql/tests/test_unicode.py (rev 0)
+++ SQLObject/trunk/sqlobject/mysql/tests/test_unicode.py 2007-09-26 19:41:09 UTC (rev 2996)
@@ -0,0 +1,33 @@
+#!/usr/bin/python
+
+from py.test import raises
+
+from sqlobject import *
+
+sqlhub.processConnection = connectionForURI('mysql://nz:newzed@localhost/nz')
+
+from sqlobject.tests.dbtest import *
+
+class MyTable(SQLObject):
+ strc = StringCol()
+ unic = UnicodeCol()
+ bloc = BLOBCol()
+
+
+
+def test_unicode():
+
+ #MyTable.dropTable(ifExists=True)
+ MyTable.createTable(ifNotExists=True)
+
+ #test plain text
+ MyTable(strc="plain", unic="text", bloc="col")
+
+ #test unicode objects that are plain text
+ MyTable(strc=u"plain", unic=u"text", bloc="col")
+
+ #test string that contain non-plain-text
+ #note: unicode column should be in unicode.
+ #blob column should be text.
+ MyTable(strc="", unic=u"\x82", bloc="\x82")
+
|