Commit f119b083 authored by Romain Courteaud's avatar Romain Courteaud

Test Hosting Subscription fixConsistency.

fixConsistency can be called twice in the same transaction.
parent 055b3c78
......@@ -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)
......@@ -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>
......
53
\ No newline at end of file
54
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment