From: Tony Locke Date: Mon, 23 Jun 2014 19:45:16 +0000 (+0100) Subject: pg8000 passing test/sql X-Git-Tag: rel_0_9_7~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d1dcc32f6695fcd2d0ac622254d76019dad3c02;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git pg8000 passing test/sql --- diff --git a/test/sql/test_case_statement.py b/test/sql/test_case_statement.py index 998a55cd84..2966fd9ba1 100644 --- a/test/sql/test_case_statement.py +++ b/test/sql/test_case_statement.py @@ -73,14 +73,18 @@ class CaseTest(fixtures.TestBase, AssertsCompiledSQL): ('gt3', 6, 'pk_6_data') ] - w_else = select([case([ - [info_table.c.pk < 3, - 3], - [and_(info_table.c.pk >= 3, info_table.c.pk < 6), - 6]], - else_ = 0).label('x'), - info_table.c.pk, info_table.c.info], - from_obj=[info_table]) + w_else = select( + [ + case( + [ + [info_table.c.pk < 3, cast(3, Integer)], + [ + and_( + info_table.c.pk >= 3, info_table.c.pk < 6), + 6]], + else_ = 0).label('x'), + info_table.c.pk, info_table.c.info], + from_obj=[info_table]) else_result = w_else.execute().fetchall() diff --git a/test/sql/test_defaults.py b/test/sql/test_defaults.py index ba6166ea6a..d511de229e 100644 --- a/test/sql/test_defaults.py +++ b/test/sql/test_defaults.py @@ -6,7 +6,7 @@ import sqlalchemy as sa from sqlalchemy import testing from sqlalchemy.testing import engines from sqlalchemy import MetaData, Integer, String, ForeignKey, Boolean, exc,\ - Sequence, func, literal, Unicode + Sequence, func, literal, Unicode, cast from sqlalchemy.types import TypeDecorator, TypeEngine from sqlalchemy.testing.schema import Table, Column from sqlalchemy.dialects import sqlite @@ -1064,7 +1064,7 @@ class SpecialTypePKTest(fixtures.TestBase): self._run_test(server_default='1', autoincrement=False) def test_clause(self): - stmt = select([literal("INT_1", type_=self.MyInteger)]).as_scalar() + stmt = select([cast("INT_1", type_=self.MyInteger)]).as_scalar() self._run_test(default=stmt) @testing.requires.returning diff --git a/test/sql/test_query.py b/test/sql/test_query.py index 65bb2e07c4..ca21504432 100644 --- a/test/sql/test_query.py +++ b/test/sql/test_query.py @@ -610,11 +610,11 @@ class QueryTest(fixtures.TestBase): return "INT_%d" % value eq_( - testing.db.scalar(select([literal("INT_5", type_=MyInteger)])), + testing.db.scalar(select([cast("INT_5", type_=MyInteger)])), "INT_5" ) eq_( - testing.db.scalar(select([literal("INT_5", type_=MyInteger).label('foo')])), + testing.db.scalar(select([cast("INT_5", type_=MyInteger).label('foo')])), "INT_5" )