<s> from decimal import Decimal <EOL> from django . test import TestCase <EOL> from satchmo_utils . numbers import round_decimal , trunc_decimal <EOL> class TestRoundedDecimals ( TestCase ) : <EOL> def testRoundingDecimals ( self ) : <EOL> """<STR_LIT>""" <EOL> val = round_decimal ( val = <NUM_LIT> , places = <NUM_LIT:5> , roundfactor = <NUM_LIT> , normalize = True ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT>" ) ) <EOL> val = round_decimal ( val = <NUM_LIT> , places = <NUM_LIT:5> , roundfactor = - <NUM_LIT> , normalize = True ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT:3>" ) ) <EOL> val = round_decimal ( val = <NUM_LIT:0> , places = <NUM_LIT:5> , roundfactor = - <NUM_LIT> , normalize = False ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT>" ) ) <EOL> val = round_decimal ( <NUM_LIT:0> , <NUM_LIT:5> , - <NUM_LIT> , False ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT>" ) ) <EOL> val = round_decimal ( <NUM_LIT:0> ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT:0>" ) ) <EOL> val = round_decimal ( <NUM_LIT> , <NUM_LIT:4> , - <NUM_LIT> ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT:3>" ) ) <EOL> val = round_decimal ( - <NUM_LIT> , <NUM_LIT:4> , - <NUM_LIT> ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT>" ) ) <EOL> val = round_decimal ( - <NUM_LIT> , <NUM_LIT:4> , <NUM_LIT> ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT>" ) ) <EOL> val = round_decimal ( <NUM_LIT> , <NUM_LIT:4> , <NUM_LIT> ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT>" ) ) <EOL> val = round_decimal ( <NUM_LIT> , <NUM_LIT:4> , <NUM_LIT> , False ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT>" ) ) <EOL> val = round_decimal ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT> , False ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT>" ) ) <EOL> val = round_decimal ( <NUM_LIT> , places = <NUM_LIT:2> ) <EOL> self . assertEqual ( val , Decimal ( '<STR_LIT>' ) ) <EOL> def testTruncDecimal ( self ) : <EOL> """<STR_LIT>""" <EOL> val = trunc_decimal ( "<STR_LIT>" , <NUM_LIT:2> ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT>" ) ) <EOL> val = trunc_decimal ( "<STR_LIT>" , <NUM_LIT:2> ) <EOL> self . assertEqual ( val , Decimal ( "<STR_LIT>" ) ) <EOL> val = trunc_decimal ( "<STR_LIT>" , places = <NUM_LIT:2> ) <EOL> self . assertEqual ( val , Decimal ( '<STR_LIT>' ) ) <EOL> val = trunc_decimal ( <NUM_LIT> , places = <NUM_LIT:2> ) <EOL> self . assertEqual ( val , Decimal ( '<STR_LIT>' ) ) <EOL> val = trunc_decimal ( <NUM_LIT> , places = <NUM_LIT:2> ) <EOL> self . assertEqual ( val , Decimal ( '<STR_LIT>' ) ) <EOL> val = trunc_decimal ( "<STR_LIT>" , places = <NUM_LIT:2> ) <EOL> self . assertEqual ( val , Decimal ( '<STR_LIT>' ) ) </s>
