Commit e0c6feb3 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: (AccountingBuilder) Now Invoice Lines contains dates

parent 3574c2fc
...@@ -18,7 +18,7 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin): ...@@ -18,7 +18,7 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
self.assertNotEqual(None, simulation_movement.getDeliveryValue()) self.assertNotEqual(None, simulation_movement.getDeliveryValue())
def checkDeliveryLine(self, simulation_movement, delivery_line, def checkDeliveryLine(self, simulation_movement, delivery_line,
line_portal_type, cell_portal_type): line_portal_type, cell_portal_type, has_date_on_line):
self.assertEqual(line_portal_type, delivery_line.getPortalType()) self.assertEqual(line_portal_type, delivery_line.getPortalType())
self.assertSameSet([ self.assertSameSet([
'use/trade/sale', 'use/trade/sale',
...@@ -35,8 +35,8 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin): ...@@ -35,8 +35,8 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
delivery_line.getQuantity()) delivery_line.getQuantity())
self.assertEqual(simulation_movement.getPrice(), self.assertEqual(simulation_movement.getPrice(),
delivery_line.getPrice()) delivery_line.getPrice())
self.assertFalse(delivery_line.hasStartDate()) self.assertEqual(delivery_line.hasStartDate(), has_date_on_line)
self.assertFalse(delivery_line.hasStopDate()) self.assertEqual(delivery_line.hasStopDate(), has_date_on_line)
self.assertEqual([], delivery_line.contentValues( self.assertEqual([], delivery_line.contentValues(
portal_type=cell_portal_type)) portal_type=cell_portal_type))
self.assertSameSet([simulation_movement.getRelativeUrl()], self.assertSameSet([simulation_movement.getRelativeUrl()],
...@@ -128,7 +128,8 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin): ...@@ -128,7 +128,8 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
delivery_line_2.getRelativeUrl()) delivery_line_2.getRelativeUrl())
line_kw = dict(line_portal_type='Sale Packing List Line', line_kw = dict(line_portal_type='Sale Packing List Line',
cell_portal_type='Sale Packing List Cell') cell_portal_type='Sale Packing List Cell',
has_date_on_line=False)
self.checkDeliveryLine(simulation_movement_1, delivery_line_1, **line_kw) self.checkDeliveryLine(simulation_movement_1, delivery_line_1, **line_kw)
self.checkDeliveryLine(simulation_movement_2, delivery_line_2, **line_kw) self.checkDeliveryLine(simulation_movement_2, delivery_line_2, **line_kw)
...@@ -325,7 +326,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder): ...@@ -325,7 +326,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
invoice_line_1_bis.getParentValue()) invoice_line_1_bis.getParentValue())
line_kw = dict(line_portal_type='Invoice Line', line_kw = dict(line_portal_type='Invoice Line',
cell_portal_type='Invoice Cell') cell_portal_type='Invoice Cell',
has_date_on_line=True)
self.checkDeliveryLine(invoice_movement_1, invoice_line_1, **line_kw) self.checkDeliveryLine(invoice_movement_1, invoice_line_1, **line_kw)
self.checkDeliveryLine(invoice_movement_1_bis, invoice_line_1_bis, self.checkDeliveryLine(invoice_movement_1_bis, invoice_line_1_bis,
**line_kw) **line_kw)
......
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