Jauges Go to matching
This commit is contained in:
@@ -2764,6 +2764,25 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
patch.object(lot_module.LotQt, 'search', return_value=[]):
|
||||
lot_module.LotQt.match_lots([purchase_lot], [])
|
||||
|
||||
def test_lot_matching_gauge_uses_entered_quantity_to_match(self):
|
||||
'go to matching gauge projects tolerance from qt to match'
|
||||
matching_lot = lot_module.LotMatchingLot()
|
||||
matching_lot.lot_theoretical_qt = Decimal('100')
|
||||
matching_lot.lot_already_matched_qt = Decimal('40')
|
||||
matching_lot.lot_matched_qt = Decimal('65')
|
||||
matching_lot.lot_tol_min = Decimal('5')
|
||||
matching_lot.lot_tol_max = Decimal('10')
|
||||
|
||||
self.assertEqual(
|
||||
matching_lot.on_change_with_lot_tolerance_used(),
|
||||
Decimal('5.00000'))
|
||||
self.assertEqual(
|
||||
matching_lot.on_change_with_lot_tolerance_min(),
|
||||
Decimal('-5'))
|
||||
self.assertEqual(
|
||||
matching_lot.on_change_with_lot_tolerance_max(),
|
||||
Decimal('10'))
|
||||
|
||||
def test_go_matching_defaults_selected_open_lot_qts(self):
|
||||
'go to matching only preloads selected unmatched open lot.qt rows'
|
||||
purchase = Mock(id=10, party=Mock(id=20))
|
||||
|
||||
Reference in New Issue
Block a user