Commit 959f7c74 authored by Łukasz Nowak's avatar Łukasz Nowak

Consider update line.

parent 2cd31483
......@@ -481,7 +481,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
# 1 invoice line is expected
invoice_line_list = sale_invoice.contentValues(
portal_type="Invoice Line")
self.assertEquals(3, len(invoice_line_list))
self.assertEquals(4, len(invoice_line_list))
service_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_setup'][0]
......@@ -489,6 +489,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
if x.getResource() == 'service_module/vifib_instance_subscription'][0]
hosting_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_hosting'][0]
update_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_update'][0]
self.assertEquals(True, service_line.hasPrice())
self.assertAlmostEquals(0, service_line.getPrice(), 3)
......@@ -502,6 +504,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self.assertAlmostEquals(0, hosting_line.getPrice(), 3)
self.assertEquals(1, hosting_line.getQuantity())
self.assertEquals(True, update_line.hasPrice())
self.assertAlmostEquals(0, update_line.getPrice(), 3)
self.assertEquals(1, update_line.getQuantity())
# 0 transaction line
transaction_line_list = sale_invoice.contentValues(
portal_type="Sale Invoice Transaction Line")
......@@ -567,7 +573,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
# 1 invoice line is expected
invoice_line_list = sale_invoice.contentValues(
portal_type="Invoice Line")
self.assertEquals(4, len(invoice_line_list))
self.assertEquals(5, len(invoice_line_list))
service_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_setup'][0]
......@@ -577,6 +583,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
if x.getResource() == 'service_module/vifib_instance_hosting'][0]
destroy_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_cleanup'][0]
update_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_update'][0]
self.assertEquals(True, service_line.hasPrice())
self.assertAlmostEquals(0, service_line.getPrice(), 3)
......@@ -594,6 +602,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self.assertAlmostEquals(0, destroy_line.getPrice(), 3)
self.assertEquals(1, destroy_line.getQuantity())
self.assertEquals(True, update_line.hasPrice())
self.assertAlmostEquals(0, update_line.getPrice(), 3)
self.assertEquals(2, update_line.getQuantity())
# 0 transaction line
transaction_line_list = sale_invoice.contentValues(
portal_type="Sale Invoice Transaction Line")
......@@ -653,10 +665,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self.assertAlmostEquals(
1, sale_invoice.getTotalPrice(), 3)
# 5 invoice lines are expected
# 6 invoice lines are expected
invoice_line_list = sale_invoice.contentValues(
portal_type="Invoice Line")
self.assertEquals(5, len(invoice_line_list))
self.assertEquals(6, len(invoice_line_list))
service_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_setup'][0]
......@@ -666,6 +678,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
if x.getResource() == 'service_module/vifib_instance_hosting'][0]
destroy_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_cleanup'][0]
update_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_update'][0]
tax_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_tax'][0]
......@@ -685,6 +699,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self.assertAlmostEquals(0, destroy_line.getPrice(), 3)
self.assertEquals(1, destroy_line.getQuantity())
self.assertEquals(True, update_line.hasPrice())
self.assertAlmostEquals(0, update_line.getPrice(), 3)
self.assertEquals(2, update_line.getQuantity())
self.assertEquals(True, tax_line.hasPrice())
self.assertAlmostEquals(0.196, tax_line.getPrice(), 3)
self.assertAlmostEquals(0.836, tax_line.getQuantity(), 3)
......@@ -826,7 +844,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
# 5 invoice lines are expected
invoice_line_list = sale_invoice.contentValues(
portal_type="Invoice Line")
self.assertEquals(5, len(invoice_line_list))
self.assertEquals(6, len(invoice_line_list))
service_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_setup'][0]
......@@ -836,6 +854,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
if x.getResource() == 'service_module/vifib_instance_hosting'][0]
destroy_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_cleanup'][0]
update_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_update'][0]
tax_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_tax'][0]
......@@ -855,6 +875,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self.assertAlmostEquals(0, destroy_line.getPrice(), 3)
self.assertEquals(1, destroy_line.getQuantity())
self.assertEquals(True, update_line.hasPrice())
self.assertAlmostEquals(0, update_line.getPrice(), 3)
self.assertEquals(2, update_line.getQuantity())
self.assertEquals(True, tax_line.hasPrice())
self.assertAlmostEquals(0.196, tax_line.getPrice(), 3)
self.assertAlmostEquals(0.836, tax_line.getQuantity(), 3)
......@@ -1133,7 +1157,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
# 5 invoice lines are expected
invoice_line_list = sale_invoice.contentValues(
portal_type="Invoice Line")
self.assertEquals(5, len(invoice_line_list))
self.assertEquals(6, len(invoice_line_list))
service_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_setup'][0]
......@@ -1143,6 +1167,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
if x.getResource() == 'service_module/vifib_instance_hosting'][0]
destroy_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_cleanup'][0]
update_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_instance_update'][0]
tax_line = [x for x in invoice_line_list \
if x.getResource() == 'service_module/vifib_tax'][0]
......@@ -1162,6 +1188,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self.assertAlmostEquals(0, destroy_line.getPrice(), 3)
self.assertEquals(2, destroy_line.getQuantity())
self.assertEquals(True, update_line.hasPrice())
self.assertAlmostEquals(0, update_line.getPrice(), 3)
self.assertEquals(6, update_line.getQuantity())
self.assertEquals(True, tax_line.hasPrice())
self.assertAlmostEquals(0.196, tax_line.getPrice(), 3)
self.assertAlmostEquals(1.672, tax_line.getQuantity(), 3)
......
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