summaryrefslogtreecommitdiff
path: root/test/dialect/postgres.py
diff options
context:
space:
mode:
authorAnts Aasma <ants.aasma@gmail.com>2008-01-03 23:38:55 +0000
committerAnts Aasma <ants.aasma@gmail.com>2008-01-03 23:38:55 +0000
commitefb89f211319b19231260572422e4814639cace7 (patch)
treec9cee21703d2fd117a3fe3ce8e49cdff637f321e /test/dialect/postgres.py
parentebe83b95ad24ae72a151a5f5fdd01a44ceccfef1 (diff)
downloadsqlalchemy-efb89f211319b19231260572422e4814639cace7.tar.gz
fix not calling the result processor of PGArray subtypes. (a rather embarrasing copypaste error) [ticket:913]
Diffstat (limited to 'test/dialect/postgres.py')
-rw-r--r--test/dialect/postgres.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/dialect/postgres.py b/test/dialect/postgres.py
index 11e2c139e..78d47ef9d 100644
--- a/test/dialect/postgres.py
+++ b/test/dialect/postgres.py
@@ -658,7 +658,7 @@ class ArrayTest(AssertMixin):
arrtable = Table('arrtable', metadata,
Column('id', Integer, primary_key=True),
Column('intarr', postgres.PGArray(Integer)),
- Column('strarr', postgres.PGArray(String), nullable=False)
+ Column('strarr', postgres.PGArray(String(convert_unicode=True)), nullable=False)
)
metadata.create_all()
def tearDownAll(self):
@@ -695,5 +695,14 @@ class ArrayTest(AssertMixin):
self.assertEquals(results[0][0], [1,2,3,4,5,6])
arrtable.delete().execute()
+ def test_array_subtype_resultprocessor(self):
+ arrtable.insert().execute(intarr=[4,5,6], strarr=[[u'm\xe4\xe4'], [u'm\xf6\xf6']])
+ arrtable.insert().execute(intarr=[1,2,3], strarr=[u'm\xe4\xe4', u'm\xf6\xf6'])
+ results = arrtable.select(order_by=[arrtable.c.intarr]).execute().fetchall()
+ self.assertEquals(len(results), 2)
+ self.assertEquals(results[0]['strarr'], [u'm\xe4\xe4', u'm\xf6\xf6'])
+ self.assertEquals(results[1]['strarr'], [[u'm\xe4\xe4'], [u'm\xf6\xf6']])
+ arrtable.delete().execute()
+
if __name__ == "__main__":
testbase.main()