def test_statement_settings_find_by_account(session): """Assert that the statement settings by id works.""" bcol_account = factory_premium_payment_account() bcol_account.save() payment = factory_payment() payment.save() i = factory_invoice(payment_account=bcol_account) i.save() factory_invoice_reference(i.id).save() factory_statement_settings(payment_account_id=bcol_account.id, frequency=StatementFrequency.DAILY.value) payment_account = PaymentAccount.find_by_id(bcol_account.id) statement_settings = StatementSettingsService.find_by_account_id(payment_account.auth_account_id) assert statement_settings is not None assert statement_settings.get('current_frequency').get('frequency') == StatementFrequency.DAILY.value
def test_statement_settings_find_by_invalid_account(session): """Assert that the statement settings by id works.""" statement_settings = StatementSettingsService.find_by_account_id('someaccountid') assert bool(statement_settings) is False