You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.1 KiB

  1. # -*- coding: utf-8 -*-
  2. """Run test to import MT940 IBAN RABO import."""
  3. ##############################################################################
  4. #
  5. # Copyright (C) 2015 Therp BV <http://therp.nl>.
  6. # All other contributions are (C) by their respective contributors
  7. #
  8. # This program is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU Affero General Public License as
  10. # published by the Free Software Foundation, either version 3 of the
  11. # License, or (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU Affero General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU Affero General Public License
  19. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. #
  21. ##############################################################################
  22. from openerp.addons.account_bank_statement_import.tests import (
  23. TestStatementFile)
  24. class TestImport(TestStatementFile):
  25. """Run test to import MT940 RABO import."""
  26. def setUp(self):
  27. super(TestImport, self).setUp()
  28. import_wizard = self.env['account.bank.statement.import']
  29. import_wizard._create_bank_account(
  30. 'NL34RABO0142623393', company_id=self.env.user.company_id.id)
  31. def test_statement_import(self):
  32. """Test correct creation of single statement."""
  33. transactions = [
  34. {
  35. 'remote_account': 'NL66RABO0160878799',
  36. 'transferred_amount': 400.00,
  37. 'value_date': '2014-01-02',
  38. 'ref': 'NONREF',
  39. },
  40. ]
  41. # statement name is account number + '-' + date of last 62F line:
  42. self._test_statement_import(
  43. 'account_bank_statement_import_mt940_nl_rabo', 'test-rabo.swi',
  44. 'NL34RABO0142623393-2014-01-07',
  45. local_account='NL34RABO0142623393',
  46. start_balance=4433.52, end_balance=4798.91,
  47. transactions=transactions
  48. )