Commit c46b4aa5 authored by Romain Courteaud's avatar Romain Courteaud

Only one subscription packing list is created.

parent f79ce163
...@@ -117,7 +117,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -117,7 +117,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
.getSimulationState()) .getSimulationState())
setup_invoice_line_list = catalog(portal_type='Invoice Line', setup_invoice_line_list = catalog(portal_type='Invoice Line',
aggregate_relative_url=hosting_subscription_url,
resource_relative_url=setup_resource) resource_relative_url=setup_resource)
self.assertEqual(1, len(setup_invoice_line_list)) self.assertEqual(1, len(setup_invoice_line_list))
self.assertEqual('planned', setup_invoice_line_list[0]\ self.assertEqual('planned', setup_invoice_line_list[0]\
...@@ -131,8 +130,8 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -131,8 +130,8 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
sort_on=(('movement.start_date', 'desc'),) sort_on=(('movement.start_date', 'desc'),)
) )
self.assertEqual(2, len(subscription_delivery_line_list)) self.assertEqual(1, len(subscription_delivery_line_list))
self.assertEqual(['confirmed'] * 2, [q.getSimulationState() for \ self.assertEqual(['delivered'], [q.getSimulationState() for \
q in subscription_delivery_line_list]) q in subscription_delivery_line_list])
subscription_invoice_line_list = catalog(portal_type='Invoice Line', subscription_invoice_line_list = catalog(portal_type='Invoice Line',
...@@ -145,8 +144,9 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -145,8 +144,9 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
self.assertEqual('solved', invoice.getCausalityState()) self.assertEqual('solved', invoice.getCausalityState())
# invoice shall have causality of one packing list # invoice shall have causality of one packing list
self.assertEqual( self.assertSameSet(
[setup_delivery_line_list[0].getParentValue().getUid()], [setup_delivery_line_list[0].getParentValue().getUid(),
subscription_delivery_line_list[0].getParentValue().getUid()],
invoice.getCausalityUidList()) invoice.getCausalityUidList())
# there shall be no payment transaction related # there shall be no payment transaction related
...@@ -168,14 +168,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -168,14 +168,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
subscription_delivery_uid=subscription_delivery_uid subscription_delivery_uid=subscription_delivery_uid
) )
def stepStartSubscriptionDelivery(self, sequence, **kw):
self.portal.portal_catalog.getResultValue(
uid=sequence['subscription_delivery_uid']).start()
def stepStopSubscriptionDelivery(self, sequence, **kw):
self.portal.portal_catalog.getResultValue(
uid=sequence['subscription_delivery_uid']).stop()
def stepCheckHostingSubscriptionStoppedDocumentCoverage(self, sequence, **kw): def stepCheckHostingSubscriptionStoppedDocumentCoverage(self, sequence, **kw):
catalog = self.portal.portal_catalog catalog = self.portal.portal_catalog
hosting_subscription = catalog.getResultValue( hosting_subscription = catalog.getResultValue(
...@@ -206,7 +198,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -206,7 +198,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
.getSimulationState()) .getSimulationState())
setup_invoice_line_list = catalog(portal_type='Invoice Line', setup_invoice_line_list = catalog(portal_type='Invoice Line',
aggregate_relative_url=hosting_subscription_url,
resource_relative_url=sequence['setup_resource']) resource_relative_url=sequence['setup_resource'])
self.assertEqual(1, len(setup_invoice_line_list)) self.assertEqual(1, len(setup_invoice_line_list))
self.assertEqual('planned', setup_invoice_line_list[0]\ self.assertEqual('planned', setup_invoice_line_list[0]\
...@@ -218,13 +209,12 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -218,13 +209,12 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
aggregate_relative_url=hosting_subscription_url, aggregate_relative_url=hosting_subscription_url,
resource_relative_url=sequence['subscription_resource']) resource_relative_url=sequence['subscription_resource'])
self.assertEqual(2, len(subscription_delivery_line_list)) self.assertEqual(1, len(subscription_delivery_line_list))
self.assertEqual(['confirmed'] + ['stopped'], self.assertEqual(['delivered'],
sorted([q.getSimulationState() for \ sorted([q.getSimulationState() for \
q in subscription_delivery_line_list])) q in subscription_delivery_line_list]))
subscription_invoice_line_list = catalog(portal_type='Invoice Line', subscription_invoice_line_list = catalog(portal_type='Invoice Line',
aggregate_relative_url=hosting_subscription_url,
resource_relative_url=sequence['subscription_resource']) resource_relative_url=sequence['subscription_resource'])
self.assertEqual(1, len(subscription_invoice_line_list)) self.assertEqual(1, len(subscription_invoice_line_list))
self.assertEqual('planned', subscription_invoice_line_list[0]\ self.assertEqual('planned', subscription_invoice_line_list[0]\
...@@ -242,7 +232,7 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -242,7 +232,7 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
# invoice shall have causality of two packing lists # invoice shall have causality of two packing lists
self.assertEqual( self.assertEqual(
sorted([setup_delivery_line_list[0].getParentValue().getUid()] + sorted([setup_delivery_line_list[0].getParentValue().getUid()] +
[q.getParentValue().getUid() for q in subscription_delivery_line_list if q.getSimulationState() == 'stopped']), [q.getParentValue().getUid() for q in subscription_delivery_line_list if q.getSimulationState() == 'delivered']),
sorted(setup_invoice_line_list[0].getParentValue().getCausalityUidList())) sorted(setup_invoice_line_list[0].getParentValue().getCausalityUidList()))
def stepSelectPlannedInvoice(self, sequence, **kw): def stepSelectPlannedInvoice(self, sequence, **kw):
...@@ -251,7 +241,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -251,7 +241,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
invoice_line = self.portal.portal_catalog.getResultValue( invoice_line = self.portal.portal_catalog.getResultValue(
portal_type='Invoice Line', portal_type='Invoice Line',
aggregate_relative_url=hosting_subscription.getRelativeUrl(),
simulation_state='planned' simulation_state='planned'
) )
...@@ -611,8 +600,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -611,8 +600,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
# that invoice got updated # that invoice got updated
SelectNextSubscriptionDelivery SelectNextSubscriptionDelivery
StartSubscriptionDelivery
StopSubscriptionDelivery
Tic Tic
TriggerBuild TriggerBuild
...@@ -633,51 +620,50 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -633,51 +620,50 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
SelectPlannedInvoice SelectPlannedInvoice
ConfirmInvoice ConfirmInvoice
Tic Tic
SelectNextSubscriptionDelivery
StartSubscriptionDelivery
StopSubscriptionDelivery
Tic
TriggerBuild
Tic
CheckHostingSubscriptionConfirmedInvoiceDocumentCoverage
# Lets check the payment
StartInvoice
StopInvoice
Tic
TriggerBuild
Tic
CheckHostingSubscriptionStoppedInvoiceDocumentCoverage
# Proof that alarm is capable to stop previous month invoice
SelectPlannedInvoice
InvoiceSetStartDatePreviousMonth
Tic
TriggerConfirmPlannedInvoiceAlarm
Tic
TriggerStopConfirmedInvoiceAlarm
Tic
# Payment should cover both invoices
TriggerBuild
Tic
CheckHostingSubscriptionTwoStoppedInvoiceDocumentCoverage
ConfirmPayment
Tic
CheckPayment
LoginERP5TypeTestCase
CheckSiteConsistency
Logout
""" """
# SelectNextSubscriptionDelivery
# Tic
#
# TriggerBuild
# Tic
#
# CheckHostingSubscriptionConfirmedInvoiceDocumentCoverage
#
# # Lets check the payment
#
# StartInvoice
# StopInvoice
# Tic
#
# TriggerBuild
# Tic
#
# CheckHostingSubscriptionStoppedInvoiceDocumentCoverage
#
# # Proof that alarm is capable to stop previous month invoice
# SelectPlannedInvoice
# InvoiceSetStartDatePreviousMonth
# Tic
# TriggerConfirmPlannedInvoiceAlarm
# Tic
# TriggerStopConfirmedInvoiceAlarm
# Tic
#
# # Payment should cover both invoices
# TriggerBuild
# Tic
#
# CheckHostingSubscriptionTwoStoppedInvoiceDocumentCoverage
#
# ConfirmPayment
# Tic
# CheckPayment
#
# LoginERP5TypeTestCase
# CheckSiteConsistency
# Logout
# """
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
......
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