From: Mike Bayer Date: Thu, 16 Feb 2017 18:00:28 +0000 (-0500) Subject: - add test for inserting PG array w/ NULL, references #3916 X-Git-Tag: rel_1_1_6~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42bb86568919a7198090235b4ab8293366866fdd;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - add test for inserting PG array w/ NULL, references #3916 Change-Id: I87be274c1ba019b41744a5a76c1b5e9334564ec8 --- diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py index ddc121a8bf..3f2f6db3f7 100644 --- a/test/dialect/postgresql/test_types.py +++ b/test/dialect/postgresql/test_types.py @@ -1064,6 +1064,15 @@ class ArrayRoundTripTest(fixtures.TablesTest, AssertsExecutionResults): eq_(results[0]['intarr'], [1, 2, 3]) eq_(results[0]['strarr'], [util.u('abc'), util.u('def')]) + def test_insert_array_w_null(self): + arrtable = self.tables.arrtable + arrtable.insert().execute(intarr=[1, None, 3], strarr=[util.u('abc'), + None]) + results = arrtable.select().execute().fetchall() + eq_(len(results), 1) + eq_(results[0]['intarr'], [1, None, 3]) + eq_(results[0]['strarr'], [util.u('abc'), None]) + def test_array_where(self): arrtable = self.tables.arrtable arrtable.insert().execute(intarr=[1, 2, 3], strarr=[util.u('abc'),