Commit 5b33911a authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription_request: Relies on Sale Supplies for define pricing for Reservation.

parent 27dab6a3
......@@ -43,7 +43,7 @@
</item>
<item>
<key> <string>quantity</string> </key>
<value> <float>25.0</float> </value>
<value> <float>0.0</float> </value>
</item>
</dictionary>
</pickle>
......
......@@ -55,7 +55,7 @@
</item>
<item>
<key> <string>quantity</string> </key>
<value> <float>-25.0</float> </value>
<value> <float>0.0</float> </value>
</item>
</dictionary>
</pickle>
......
......@@ -43,7 +43,7 @@
</item>
<item>
<key> <string>quantity</string> </key>
<value> <float>188.0</float> </value>
<value> <float>0.0</float> </value>
</item>
</dictionary>
</pickle>
......
......@@ -55,7 +55,7 @@
</item>
<item>
<key> <string>quantity</string> </key>
<value> <float>-188.0</float> </value>
<value> <float>0.0</float> </value>
</item>
</dictionary>
</pickle>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>base_unit_price</string> </key>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
......@@ -54,7 +58,7 @@
</item>
<item>
<key> <string>price</string> </key>
<value> <float>20.8333333333</float> </value>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>quantity</string> </key>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>base_unit_price</string> </key>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
......@@ -53,7 +57,7 @@
</item>
<item>
<key> <string>price</string> </key>
<value> <float>188.0</float> </value>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>quantity</string> </key>
......
......@@ -561,43 +561,43 @@ class TestSubscriptionRequest_requestPaymentTransaction(TestSubscriptionSkinsMix
if line.getSource() == "account_module/receivable":
self.assertEqual(line.getQuantity(), 188*quantity)
@simulate('SubscriptionRequest_createRelatedSaleInvoiceTransaction', 'amount, tag, payment, target_language, REQUEST=None',"""assert REQUEST == None
@simulate('SubscriptionRequest_createRelatedSaleInvoiceTransaction', 'price, tag, payment, template, REQUEST=None',"""assert REQUEST == None
assert payment
assert amount == 1
assert price == 20.8333333
assert tag == 'TAG'
assert target_language == 'en'""")
assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate()""")
def test_request_payment_transaction_q1(self):
self._test_request_payment_transaction(quantity=1)
@simulate('SubscriptionRequest_createRelatedSaleInvoiceTransaction', 'amount, tag, payment, target_language, REQUEST=None',"""assert REQUEST == None
@simulate('SubscriptionRequest_createRelatedSaleInvoiceTransaction', 'price, tag, payment, template, REQUEST=None',"""assert REQUEST == None
assert payment
assert amount == 2
assert price == 20.8333333
assert tag == 'TAG'
assert target_language == 'en'""")
assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate()""")
def test_request_payment_transaction_q2(self):
self._test_request_payment_transaction(quantity=2)
@simulate('SubscriptionRequest_createRelatedSaleInvoiceTransaction', 'amount, tag, payment, target_language, REQUEST=None',"""assert REQUEST == None
@simulate('SubscriptionRequest_createRelatedSaleInvoiceTransaction', 'price, tag, payment, template, REQUEST=None',"""assert REQUEST == None
assert payment
assert amount == 10
assert price == 20.8333333
assert tag == 'TAG'
assert target_language == 'en'""")
assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate()""")
def test_request_payment_transaction_q10(self):
self._test_request_payment_transaction(quantity=10)
@simulate('SubscriptionRequest_createRelatedSaleInvoiceTransaction', 'amount, tag, payment, target_language, REQUEST=None',"""assert REQUEST == None
@simulate('SubscriptionRequest_createRelatedSaleInvoiceTransaction', 'price, tag, payment, template, REQUEST=None',"""assert REQUEST == None
assert payment
assert amount == 1
assert price == 188
assert tag == 'TAG'
assert target_language == 'zh'""")
assert template == context.portal_preferences.getPreferredZhPrePaymentSubscriptionInvoiceTemplate()""")
def test_request_payment_transaction_chinese_q1(self):
self._test_request_payment_transaction_chinese(quantity=1)
@simulate('SubscriptionRequest_createRelatedSaleInvoiceTransaction', 'amount, tag, payment, target_language, REQUEST=None',"""assert REQUEST == None
@simulate('SubscriptionRequest_createRelatedSaleInvoiceTransaction', 'price, tag, payment, template, REQUEST=None',"""assert REQUEST == None
assert payment
assert amount == 10
assert price == 188
assert tag == 'TAG'
assert target_language == 'zh'""")
assert template == context.portal_preferences.getPreferredZhPrePaymentSubscriptionInvoiceTemplate()""")
def test_request_payment_transaction_chinese_q10(self):
self._test_request_payment_transaction_chinese(quantity=10)
......@@ -621,7 +621,7 @@ class TestSubscriptionRequest_createRelatedSaleInvoiceTransaction(TestSubscripti
subscription_request.edit(causality_value=current_invoice)
self.assertEqual(current_invoice,
subscription_request.SubscriptionRequest_createRelatedSaleInvoiceTransaction(1, "xx", "___payment__", "en"))
subscription_request.SubscriptionRequest_createRelatedSaleInvoiceTransaction(1, "xx", "___payment__", invoice_template_path))
def _test_creation_of_related_sale_invoice_transaction(self, quantity):
......
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