• Nicolas Dumazet's avatar
    getAggregatedAmountList: generated temporary ids must be context-dependent · 5480a87e
    Nicolas Dumazet authored
    This fixes an interesting bug:
      # Takes place during indexing phase, when Transactional Cache is on
    
      # A transformation is defined, producing a (blue|red) resource from
      # (blue|red) fabric
      transformation = ...
    
      movement1 = newTempMovement(colour="blue", resource=A)
      movement2 = newTempMovement(colour="red", resource=A)
    
      amount1 = transformation.getAggregatedAmountList(movement1)[0]
      amount2 = transformation.getAggregatedAmountList(movement2)[0]
    
      # amount1 and amount2 have wrongly the same Physical path.
      # Which means that due to caching in CategoryTool, the category
      # values will be computed only once instead of twice:
      assert amount1.getVariationText() == "colour/blue" #OK
      assert amount2.getVariationText() == "colour/blue" # !!
    
    
    
    git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33314 20353a03-c40f-0410-a6d1-a30d3c3de9de
    5480a87e
TransformedResource.py 14.9 KB