Skip to content

Commit

Permalink
[MIG] account_statement_import_ofx: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-filament committed Sep 24, 2024
1 parent fe70b66 commit d69bebe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions account_statement_import_ofx/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Import OFX Bank Statement",
"category": "Banking addons",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "Odoo SA,"
"Akretion,"
Expand All @@ -14,7 +14,7 @@
"development_status": "Mature",
"website": "https://github.com/OCA/bank-statement-import",
"depends": ["account_statement_import_file"],
"data": ["views/account_statement_import.xml"],
"data": ["wizard/account_statement_import.xml"],
"external_dependencies": {"python": ["ofxparse"]},
"installable": True,
}
20 changes: 8 additions & 12 deletions account_statement_import_ofx/tests/test_import_bank_statement.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import base64
import datetime

from odoo.modules.module import get_module_resource
from odoo.tests.common import TransactionCase
from odoo.tools.misc import file_path


class TestOfxFile(TransactionCase):
Expand All @@ -11,7 +11,7 @@ class TestOfxFile(TransactionCase):
"""

def setUp(self):
super(TestOfxFile, self).setUp()
super().setUp()
self.asi_model = self.env["account.statement.import"]
self.abs_model = self.env["account.bank.statement"]
self.j_model = self.env["account.journal"]
Expand Down Expand Up @@ -56,10 +56,8 @@ def setUp(self):
)

def test_wrong_ofx_file_import(self):
ofx_file_path = get_module_resource(
"account_statement_import_ofx",
"tests/test_ofx_file/",
"test_ofx_wrong.ofx",
ofx_file_path = file_path(
"account_statement_import_ofx/tests/test_ofx_file/test_ofx_wrong.ofx"
)
ofx_file_wrong = base64.b64encode(open(ofx_file_path, "rb").read())
bank_statement = self.asi_model.create(
Expand All @@ -71,8 +69,8 @@ def test_wrong_ofx_file_import(self):
self.assertFalse(bank_statement._check_ofx(data_file=ofx_file_wrong))

def test_ofx_file_import(self):
ofx_file_path = get_module_resource(
"account_statement_import_ofx", "tests/test_ofx_file/", "test_ofx.ofx"
ofx_file_path = file_path(
"account_statement_import_ofx/tests/test_ofx_file/test_ofx.ofx"
)
ofx_file = base64.b64encode(open(ofx_file_path, "rb").read())
bank_statement = self.asi_model.create(
Expand All @@ -95,10 +93,8 @@ def test_ofx_file_import(self):
self.assertEqual(line.date, datetime.date(2013, 8, 24))

def test_check_journal_bank_account(self):
ofx_file_path = get_module_resource(
"account_statement_import_ofx",
"tests/test_ofx_file/",
"test_ofx_iban.ofx",
ofx_file_path = file_path(
"account_statement_import_ofx/tests/test_ofx_file/test_ofx_iban.ofx"
)
ofx_file = base64.b64encode(open(ofx_file_path, "rb").read())
bank_st = self.asi_model.create(
Expand Down

0 comments on commit d69bebe

Please sign in to comment.