From d92177cede956e4ca12e0fdad5021bdd54715161 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 25 Jul 2014 16:08:21 -0400 Subject: - Fixed bug in :class:`.postgresql.array` object where comparison to a plain Python list would fail to use the correct array constructor. Pull request courtesy Andrew. fixes #3141 --- test/dialect/postgresql/test_compiler.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/dialect/postgresql/test_compiler.py') diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index c71852d90..b08fb0160 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -501,6 +501,16 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): 'param_3': 3, 'param_2': 2} ) + def test_array_literal_compare(self): + self.assert_compile( + postgresql.array([1, 2]) == [3, 4, 5], + "ARRAY[%(param_1)s, %(param_2)s] = " + "ARRAY[%(param_3)s, %(param_4)s, %(param_5)s]", + checkparams={'param_5': 5, 'param_4': 4, 'param_1': 1, + 'param_3': 3, 'param_2': 2} + + ) + def test_array_literal_insert(self): m = MetaData() t = Table('t', m, Column('data', postgresql.ARRAY(Integer))) -- cgit v1.2.1