From 0507db4f937eb600f7596a17d1c9bc590de0df44 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Wed, 31 May 2017 10:50:17 +0200 Subject: [PATCH] [ADD] account_export_csv: unit test. --- account_export_csv/tests/__init__.py | 1 + .../tests/test_account_export_csv.py | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 account_export_csv/tests/__init__.py create mode 100644 account_export_csv/tests/test_account_export_csv.py diff --git a/account_export_csv/tests/__init__.py b/account_export_csv/tests/__init__.py new file mode 100644 index 00000000..d94ad021 --- /dev/null +++ b/account_export_csv/tests/__init__.py @@ -0,0 +1 @@ +from . import test_account_export_csv diff --git a/account_export_csv/tests/test_account_export_csv.py b/account_export_csv/tests/test_account_export_csv.py new file mode 100644 index 00000000..eaa1c657 --- /dev/null +++ b/account_export_csv/tests/test_account_export_csv.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from datetime import date +from dateutil import relativedelta + +from odoo.tests.common import TransactionCase +from odoo import fields + + +class TestAccountExportCsv(TransactionCase): + + def setUp(self): + super(TestAccountExportCsv, self).setUp() + self.report_wizard = self.env['account.csv.export'] + today_dt = date.today() + next_month_date = today_dt + relativedelta.relativedelta(months=1) + self.report_date_start = fields.Date.to_string(today_dt) + self.report_date_end = fields.Date.to_string(next_month_date) + + def test_1(self): + report_wizard = self.report_wizard.create({ + 'date_start': self.report_date_start, + 'date_end': self.report_date_end + }) + report_wizard.action_manual_export_account() + + def test_2(self): + report_wizard = self.report_wizard.create({ + 'date_start': self.report_date_start, + 'date_end': self.report_date_end + }) + report_wizard.action_manual_export_analytic() + + def test_3(self): + report_wizard = self.report_wizard.create({ + 'date_start': self.report_date_start, + 'date_end': self.report_date_end + }) + report_wizard.action_manual_export_journal_entries() +