Changes between Initial Version and Version 1 of Ticket #27825, comment 3
- Timestamp:
- Feb 9, 2017, 10:58:14 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27825, comment 3
initial v1 9 9 10 10 from decimal import Decimal 11 12 11 13 class TestSave(unittest.TestCase): 14 # I am failing 12 15 def test_cast_on_save(self): 13 16 data = {'amount_cash': 12.34} … … 16 19 self.assertIsInstance(instance, Decimal) 17 20 21 # I am failing 18 22 def test_truncate_on_save(): 19 23 data = {'amount_cash': Decimal(12.3456)} … … 21 25 instance.save() 22 26 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))) 23 42 }}}