diff --git a/master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingInteractionWorkflow.py b/master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingInteractionWorkflow.py index 41a6e552f397871f5e1d6acdaca42a1e2783e316..b2dda3c59c140a0d3863303de405870dce8f700e 100644 --- a/master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingInteractionWorkflow.py +++ b/master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingInteractionWorkflow.py @@ -136,3 +136,26 @@ class TestSlapOSAccountingInteractionWorkflow(testSlapOSMixin): instance.requestStop(**request_kw) self.assertEqual(instance.getCausalityState(), 'diverged') + + def test_HostingSubscription_fixConsistency(self): + new_id = self.generateNewId() + item = self.portal.hosting_subscription_module.newContent( + portal_type='Hosting Subscription', + title="Subscription %s" % new_id, + reference="TESTSUB-%s" % new_id, + periodicity_hour_list=None, + periodicity_minute_list=None, + periodicity_month_day=None, + ) + + self.assertEqual(item.getPeriodicityHour(), None) + self.assertEqual(item.getPeriodicityMinute(), None) + self.assertEqual(item.getPeriodicityMonthDay(), None) + + item.fixConsistency() + + import datetime + self.assertEqual(item.getPeriodicityHourList(), [0]) + self.assertEqual(item.getPeriodicityMinuteList(), [0]) + self.assertEqual(item.getPeriodicityMonthDay(), datetime.datetime.today().day) + diff --git a/master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_accounting_interaction_workflow/interactions/HostingSubscription_fixConsistency.xml b/master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_accounting_interaction_workflow/interactions/HostingSubscription_fixConsistency.xml index a50e7e88c2e28604830d193d1f92e10ff643aff5..d5ad9f16427ffc903bd2d7473c2cc6309de701c8 100644 --- a/master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_accounting_interaction_workflow/interactions/HostingSubscription_fixConsistency.xml +++ b/master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_accounting_interaction_workflow/interactions/HostingSubscription_fixConsistency.xml @@ -60,7 +60,7 @@ </item> <item> <key> <string>once_per_transaction</string> </key> - <value> <int>1</int> </value> + <value> <int>0</int> </value> </item> <item> <key> <string>portal_type_filter</string> </key> diff --git a/master/bt5/slapos_accounting/bt/revision b/master/bt5/slapos_accounting/bt/revision index 8783e305111947a209a0689074d8dfa60d33582e..43c451e0c6da52ad30bb605a60c7cb34497f3d30 100644 --- a/master/bt5/slapos_accounting/bt/revision +++ b/master/bt5/slapos_accounting/bt/revision @@ -1 +1 @@ -53 \ No newline at end of file +54 \ No newline at end of file