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 camt.053 import."""
  3. ##############################################################################
  4. #
  5. # Copyright (C) 2015 Therp BV <http://therp.nl>.
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as
  9. # published by the Free Software Foundation, either version 3 of the
  10. # License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. ##############################################################################
  21. from openerp.addons.account_bank_statement_import.tests import (
  22. TestStatementFile)
  23. class TestImport(TestStatementFile):
  24. """Run test to import camt import."""
  25. def test_statement_import(self):
  26. """Test correct creation of single statement."""
  27. transactions = [
  28. {
  29. 'remote_account': 'NL46ABNA0499998748',
  30. 'transferred_amount': -754.25,
  31. 'value_date': '2014-01-05',
  32. 'ref': '435005714488-ABNO33052620',
  33. },
  34. ]
  35. self._test_statement_import(
  36. 'account_bank_statement_import_camt', 'test-camt053.xml',
  37. '2014-01-05-1234Test/1',
  38. local_account='NL77ABNA0574908765',
  39. start_balance=15568.27, end_balance=15121.12,
  40. transactions=transactions
  41. )
  42. def test_zip_import(self):
  43. """Test import of multiple statements from zip file."""
  44. self._test_statement_import(
  45. 'account_bank_statement_import_camt', 'test-camt053.zip',
  46. '2014-02-05-1234Test/2', # Only name of first statement
  47. local_account='NL77ABNA0574908765',
  48. )