Ejemplo n.º 1
0
 def test_decimal_places_requires_decimal(self):
     ccc = Column('test')
     ccc.values = [
         _decimal('-999.0000'),
         20.12355,
         _decimal('-999.00'),
     ]
     with self.assertRaises(ValueError):
         ccc.decimal_places()
Ejemplo n.º 2
0
    def test_decimal_places(self):
        """A column's decimal places is the max number of places after a decimal
        in the column.

        """
        ccc = Column('test')
        ccc.values = [
            _decimal('-999.0000'),
            _decimal('19.0'),
            _decimal('-999.000'),
            _decimal('-999.00'),
        ]
        self.assertEqual(4, ccc.decimal_places())