changeset 7f6c5411ca88 in modules/sale_advance_payment:default
details: 
https://hg.tryton.org/modules/sale_advance_payment?cmd=changeset;node=7f6c5411ca88
description:
        Allow to run test scenario during the week before the end of the year.

        The scenario creates and posts invoice 1 week in advance. So we need to 
create
        the next fiscal year in case it is run in last December days.

        issue7949
        review53511002
diffstat:

 tests/scenario_advance_payment.rst |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 33a3107ef240 -r 7f6c5411ca88 tests/scenario_advance_payment.rst
--- a/tests/scenario_advance_payment.rst        Sat Dec 29 14:20:29 2018 +0100
+++ b/tests/scenario_advance_payment.rst        Sat Dec 29 15:32:22 2018 +0100
@@ -4,7 +4,9 @@
 
 Imports::
 
+    >>> import datetime
     >>> from decimal import Decimal
+    >>> from dateutil.relativedelta import relativedelta
     >>> from proteus import Model, Wizard
     >>> from trytond.tests.tools import activate_modules
     >>> from trytond.modules.company.tests.tools import create_company, \
@@ -15,6 +17,7 @@
     ...     set_fiscalyear_invoice_sequences, create_payment_term
     >>> from trytond.modules.sale_advance_payment.tests.tools import \
     ...     create_advance_payment_term
+    >>> today = datetime.date.today()
 
 Activate sale_advance_payment::
 
@@ -25,11 +28,14 @@
     >>> _ = create_company()
     >>> company = get_company()
 
-Create fiscal year::
+Create fiscal years::
 
     >>> fiscalyear = set_fiscalyear_invoice_sequences(
-    ...     create_fiscalyear(company))
+    ...     create_fiscalyear(company, today=today))
     >>> fiscalyear.click('create_period')
+    >>> next_fiscalyear = set_fiscalyear_invoice_sequences(
+    ...     create_fiscalyear(company, today=today + relativedelta(years=1)))
+    >>> next_fiscalyear.click('create_period')
 
 Create chart of accounts::
 

Reply via email to