#NEWLINE# def test_generate_can_be_grouped_by_a_custom_field( self ) : #NEWLINE# #INDENT# result = Transaction . sale ( { #NEWLINE# #INDENT# 'amount' : TransactionAmounts . Authorize , #NEWLINE# 'credit_card' : { #NEWLINE# #INDENT# 'number' : '4111111111111111' , #NEWLINE# 'expiration_date' : '05/2012' , #NEWLINE# 'cardholder_name' : 'Sergio Ramos' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'options' : { #NEWLINE# #INDENT# 'submit_for_settlement' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# 'custom_fields' : { #NEWLINE# #INDENT# 'store_me' : 1 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# result = TestHelper . settle_transaction ( result . transaction . id ) #NEWLINE# settlement_date = result . transaction . settlement_batch_id . split ( '_' ) [ 0 ] #NEWLINE# result = SettlementBatchSummary . generate ( settlement_date , 'store_me' ) #NEWLINE# self . assertTrue ( result . is_success ) #NEWLINE# self . assertTrue ( ( 'store_me' in settlement_date . settlement_batch_summary . records [ 0 ] ) )