def create_account_section(): transactions = [] transactions.append( models.TransactionDetail( [], type_code=constants.TypeCodes['399'], amount=2599, text= 'BILLS BILLS BILLS BILLS BILLS BILLS BILLS BILLS BILLS BILLS BILLS BILLS', )) transactions.append( models.TransactionDetail( [], type_code=constants.TypeCodes['399'], amount=1000, funds_type=constants.FundsType.immediate_availability, text='OTHER', )) account_identifier = models.AccountIdentifier( [], customer_account_number='77777777', currency='GBP', summary_items=[ models.Summary(type_code=constants.TypeCodes['010'], amount=10000), models.Summary(type_code=constants.TypeCodes['015'], amount=10000), ]) return models.Account(header=account_identifier, children=transactions)
def test_account_identifier_with_continuation_renders_correctly(self): account_identifier = models.AccountIdentifier( [], customer_account_number='77777777', currency='GBP', summary_items=[ models.Summary(type_code=constants.TypeCodes['010'], amount=10000), models.Summary(type_code=constants.TypeCodes['015'], amount=10000), models.Summary(type_code=constants.TypeCodes['045'], amount=10000), models.Summary(type_code=constants.TypeCodes['040'], amount=10000), models.Summary(type_code=constants.TypeCodes['072'], amount=10000), models.Summary(type_code=constants.TypeCodes['074'], amount=10000), models.Summary(type_code=constants.TypeCodes['075'], amount=10000), models.Summary(type_code=constants.TypeCodes['400'], amount=10000, item_count=175), models.Summary(type_code=constants.TypeCodes['100'], amount=10000, item_count=50), ]) output = writers.AccountIdentifierWriter(account_identifier).write() self.assertEqual(output, [ '03,77777777,GBP,010,10000,,,015,10000,,,045,10000,,,040,10000,,,072,10000,,/', '88,074,10000,,,075,10000,,,400,10000,175,,100,10000,50,/' ])
def test_account_identifier_with_summary_availability_renders_correctly( self): account_identifier = models.AccountIdentifier( [], customer_account_number='77777777', currency='GBP', summary_items=[ models.Summary(type_code=constants.TypeCodes['010'], amount=10000, funds_type=constants.FundsType. distributed_availability_simple, availability=OrderedDict([('0', 100), ('1', 200), ('>1', 300)])), models.Summary(type_code=constants.TypeCodes['015'], amount=10000, funds_type=constants.FundsType. distributed_availability_simple, availability=OrderedDict([('0', 100), ('1', 200), ('>1', 300)])) ]) output = writers.AccountIdentifierWriter(account_identifier).write() self.assertEqual(output, [ '03,77777777,GBP,010,10000,,S,100,200,300,015,10000,,S,100,200,300/' ])
def test_account_identifier_renders_correctly(self): account_identifier = models.AccountIdentifier( customer_account_number='77777777', currency='GBP', summary_items=[ models.Summary(type_code=constants.TypeCodes['010'], amount=10000), models.Summary(type_code=constants.TypeCodes['015'], amount=10000), ]) output = writers.AccountIdentifierWriter(account_identifier).write() self.assertEqual(output, ['03,77777777,GBP,010,10000,,,015,10000,,/'])