Changes between Initial Version and Version 1 of Ticket #27825, comment 3


Ignore:
Timestamp:
Feb 9, 2017, 10:58:14 AM (7 years ago)
Author:
Oleg Belousov

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27825, comment 3

    initial v1  
    99
    1010from decimal import Decimal
     11
     12
    1113class TestSave(unittest.TestCase):
     14    # I am failing
    1215    def test_cast_on_save(self):
    1316        data = {'amount_cash': 12.34}
     
    1619        self.assertIsInstance(instance, Decimal)
    1720   
     21   # I am failing
    1822   def test_truncate_on_save():
    1923        data = {'amount_cash': Decimal(12.3456)}
     
    2125        instance.save()
    2226        self.assertEqual(5, len(str(instance.amount_cash)))
     27   
     28      # I am passing, but I am using `refresh_from_db` redundantly
     29     def test_cast_on_save(self):
     30        data = {'amount_cash': 12.34}
     31        instance = Payment(**data)
     32        instance.save()
     33        self.assertIsInstance(instance, Decimal)
     34
     35   # I am passing, but I am using `refresh_from_db` redundantly
     36   def test_truncate_on_save():
     37        data = {'amount_cash': Decimal(12.3456)}
     38        instance = Payment(**data)
     39        instance.save()
     40        instance.refresh_from_db()
     41        self.assertEqual(5, len(str(instance.amount_cash)))
    2342}}}
Back to Top