#NEWLINE# def check_stock_models( self , case , product_id , expected_soh , expected_qty , section_id ) : #NEWLINE# #INDENT# if ( not isinstance ( expected_qty , Decimal ) ) : #NEWLINE# #INDENT# expected_qty = Decimal ( str ( expected_qty ) ) #NEWLINE# #UNINDENT# if ( not isinstance ( expected_soh , Decimal ) ) : #NEWLINE# #INDENT# expected_soh = Decimal ( str ( expected_soh ) ) #NEWLINE# #UNINDENT# latest_trans = StockTransaction . latest ( case . _id , section_id , product_id ) #NEWLINE# self . assertIsNotNone ( product_id ) #NEWLINE# self . assertEqual ( section_id , latest_trans . section_id ) #NEWLINE# self . assertEqual ( expected_soh , latest_trans . stock_on_hand ) #NEWLINE# self . assertEqual ( expected_qty , latest_trans . quantity )