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):
.getSimulationState())
setup_invoice_line_list = catalog(portal_type='Invoice Line',
aggregate_relative_url=hosting_subscription_url,
resource_relative_url=setup_resource)
self.assertEqual(1, len(setup_invoice_line_list))
self.assertEqual('planned', setup_invoice_line_list[0]\
......@@ -131,8 +130,8 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
sort_on=(('movement.start_date', 'desc'),)
)
self.assertEqual(2, len(subscription_delivery_line_list))
self.assertEqual(['confirmed'] * 2, [q.getSimulationState() for \
self.assertEqual(1, len(subscription_delivery_line_list))
self.assertEqual(['delivered'], [q.getSimulationState() for \
q in subscription_delivery_line_list])
subscription_invoice_line_list = catalog(portal_type='Invoice Line',
......@@ -145,8 +144,9 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
self.assertEqual('solved', invoice.getCausalityState())
# invoice shall have causality of one packing list
self.assertEqual(
[setup_delivery_line_list[0].getParentValue().getUid()],
self.assertSameSet(
[setup_delivery_line_list[0].getParentValue().getUid(),
subscription_delivery_line_list[0].getParentValue().getUid()],
invoice.getCausalityUidList())
# there shall be no payment transaction related
......@@ -168,14 +168,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
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):
catalog = self.portal.portal_catalog
hosting_subscription = catalog.getResultValue(
......@@ -206,7 +198,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
.getSimulationState())
setup_invoice_line_list = catalog(portal_type='Invoice Line',
aggregate_relative_url=hosting_subscription_url,
resource_relative_url=sequence['setup_resource'])
self.assertEqual(1, len(setup_invoice_line_list))
self.assertEqual('planned', setup_invoice_line_list[0]\
......@@ -218,13 +209,12 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
aggregate_relative_url=hosting_subscription_url,
resource_relative_url=sequence['subscription_resource'])
self.assertEqual(2, len(subscription_delivery_line_list))
self.assertEqual(['confirmed'] + ['stopped'],
self.assertEqual(1, len(subscription_delivery_line_list))
self.assertEqual(['delivered'],
sorted([q.getSimulationState() for \
q in subscription_delivery_line_list]))
subscription_invoice_line_list = catalog(portal_type='Invoice Line',
aggregate_relative_url=hosting_subscription_url,
resource_relative_url=sequence['subscription_resource'])
self.assertEqual(1, len(subscription_invoice_line_list))
self.assertEqual('planned', subscription_invoice_line_list[0]\
......@@ -242,7 +232,7 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
# invoice shall have causality of two packing lists
self.assertEqual(
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()))
def stepSelectPlannedInvoice(self, sequence, **kw):
......@@ -251,7 +241,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
invoice_line = self.portal.portal_catalog.getResultValue(
portal_type='Invoice Line',
aggregate_relative_url=hosting_subscription.getRelativeUrl(),
simulation_state='planned'
)
......@@ -611,8 +600,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
# that invoice got updated
SelectNextSubscriptionDelivery
StartSubscriptionDelivery
StopSubscriptionDelivery
Tic
TriggerBuild
......@@ -633,51 +620,50 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
SelectPlannedInvoice
ConfirmInvoice
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.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