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.

53 lines
2.1 KiB

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