diff options
Diffstat (limited to 'test/sql/test_insert.py')
| -rw-r--r-- | test/sql/test_insert.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/sql/test_insert.py b/test/sql/test_insert.py index 8a5c7cd83..d9f7b1629 100644 --- a/test/sql/test_insert.py +++ b/test/sql/test_insert.py @@ -196,7 +196,25 @@ class InsertTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL): checkparams={} ) - + def test_insert_from_select_union(self): + mytable = self.tables.mytable + + name = 'name' + description = 'desc' + sel = select( + [name, mytable.c.description], + ).union( + select([name, description]) + ) + ins = mytable.insert().\ + from_select( + [mytable.c.name, mytable.c.description], sel) + self.assert_compile( + ins, + "INSERT INTO mytable (name, description) " + "SELECT name, mytable.description FROM mytable " + "UNION SELECT name, desc" + ) def test_insert_from_select_col_values(self): table1 = self.tables.mytable table2 = self.tables.myothertable |
