[SQL-CVS] r3497 - SQLObject/branches/0.10/sqlobject/tests
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2008-07-01 16:26:35
|
Author: phd Date: 2008-07-01 10:26:34 -0600 (Tue, 01 Jul 2008) New Revision: 3497 Modified: SQLObject/branches/0.10/sqlobject/tests/test_decimal.py Log: SQLObject always converts values to Decimal. Modified: SQLObject/branches/0.10/sqlobject/tests/test_decimal.py =================================================================== --- SQLObject/branches/0.10/sqlobject/tests/test_decimal.py 2008-07-01 16:25:01 UTC (rev 3496) +++ SQLObject/branches/0.10/sqlobject/tests/test_decimal.py 2008-07-01 16:26:34 UTC (rev 3497) @@ -14,22 +14,18 @@ col1 = DecimalCol(size=6, precision=4) if supports('decimalColumn'): - def test_1decimal(): + def test_1_decimal(): """Tests new instance with a float in col1.""" setupClass(DecimalTable) d = DecimalTable(col1=21.12) - # psycopg2 returns float as Decimal - if Decimal and isinstance(d.col1, Decimal): + if Decimal: assert d.col1 == Decimal("21.12") else: assert d.col1 == 21.12 if Decimal: - def test_2Decimal(): + def test_2_decimal(): """Tests new instance with a Decimal in col1.""" setupClass(DecimalTable) d = DecimalTable(col1=Decimal("21.12")) - if isinstance(d.col1, Decimal): - assert d.col1 == Decimal("21.12") - else: - assert d.col1 == 21.12 + assert d.col1 == Decimal("21.12") |