#NEWLINE# def test_has_discount_recorded_correctly_when_order_is_placed( self ) : #NEWLINE# #INDENT# add_product ( self . basket , D ( '12.00' ) , 1 ) #NEWLINE# utils . Applicator ( ) . apply ( self . basket ) #NEWLINE# methods = StubRepository ( ) . get_shipping_methods ( self . basket ) #NEWLINE# method = methods [ 0 ] #NEWLINE# order = factories . create_order ( basket = self . basket , shipping_method = method ) #NEWLINE# discounts = order . discounts . all ( ) #NEWLINE# self . assertEqual ( 1 , len ( discounts ) ) #NEWLINE# discount = discounts [ 0 ] #NEWLINE# self . assertTrue ( discount . is_shipping_discount ) #NEWLINE# self . assertEqual ( D ( '9.00' ) , discount . amount )