Commit 881f05ef authored by Romain Courteaud's avatar Romain Courteaud

Test getVariationCategoryList in isDivergent method.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3484 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 98844701
...@@ -448,21 +448,38 @@ class SimulationMovement(Movement): ...@@ -448,21 +448,38 @@ class SimulationMovement(Movement):
""" """
return not self.isDivergent() return not self.isDivergent()
security.declareProtected(Permissions.AccessContentsInformation, 'isDivergent') security.declareProtected(Permissions.AccessContentsInformation,
'isDivergent')
def isDivergent(self): def isDivergent(self):
""" """
Returns true if the Simulation Movement is divergent comparing to the delivery value Returns true if the Simulation Movement is divergent comparing to
the delivery value
""" """
delivery = self.getDeliveryValue() delivery = self.getDeliveryValue()
if delivery is None: if delivery is None:
return 0 return 0
# XXX Those properties are the same than defined in DeliveryBuilder.
# We need to defined it only 1 time.
if self.getSourceSection() != delivery.getSourceSection() or \ if self.getSourceSection() != delivery.getSourceSection() or \
self.getDestinationSection() != delivery.getDestinationSection() or \ self.getDestinationSection() != delivery.getDestinationSection() or \
self.getSource() != delivery.getSource() or \ self.getSource() != delivery.getSource() or \
self.getDestination() != delivery.getDestination() or \ self.getDestination() != delivery.getDestination() or \
self.getResource() != delivery.getResource() or \ self.getResource() != delivery.getResource() or \
self.getVariationCategoryList() != delivery.getVariationCategoryList()\
or \
self.getStartDate() != delivery.getStartDate() or \ self.getStartDate() != delivery.getStartDate() or \
self.getStopDate() != delivery.getStopDate(): self.getStopDate() != delivery.getStopDate():
# for method in ["getSourceSection",
# "getDestinationSection",
# "getSource",
# "getDestination",
# "getResource",
# "getVariationCategoryList",
# "getStartDate",
# "getStopDate"]:
# LOG("SimulationMovement, isDivergent", 0,
# "method: %s, self: %s , delivery: %s" % \
# tuple([method]+[str(getattr(x,method)()) for x in (self, delivery)]))
return 1 return 1
d_quantity = delivery.getQuantity() d_quantity = delivery.getQuantity()
......
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