~acsone-openerp/stock-logistic-warehouse/7.0-inventory-hierarchical-fill2-lga

« back to all changes in this revision

Viewing changes to stock_inventory_location/test/inventory_exhaustive_test.yml

[MERGE] several fixes for tests and broken refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
    inventory_state = self.read(cr, uid, [ref('inventory_exhaustive')], ['state'])[0]['state']
8
8
    assert inventory_state == 'open', "Inventory in state '%s'. It should be 'open'" % inventory_state
9
9
-
 
10
  I will check that the function get_missing_locations return some locations.
 
11
-
 
12
  !python {model: stock.inventory}: |
 
13
    missing_loc_ids = self.get_missing_locations(cr, uid, [ref('inventory_exhaustive')], context=context)
 
14
    assert len(missing_loc_ids), "get_missing_locations did not return any ID."
 
15
-
10
16
  I create a wizard record for stock_confirm_uninventoried_location to verify that it contains the uninventoried locations
11
17
-
12
18
  !python {model: stock.inventory.uninventoried.locations}: |
50
56
  The function must return True in the first case, and return a warning dictionnary in the second test.
51
57
-
52
58
  !python {model: stock.inventory.line}: |
53
 
    res = self.onchange_location_id(cr, uid, [], [(6,0,[ref('stock.stock_location_14')])], True, ref('stock.stock_location_14'))
 
59
    res = self.onchange_location_id(cr, uid, [], ref('stock.stock_location_14'), True, ref('stock.stock_location_14'))
54
60
    assert res == True, "Exhaustive: The function 'onchange_location_id' should return True and return '%s'" % res
55
 
    res = self.onchange_location_id(cr, uid, [], [(6,0,[ref('stock.stock_location_14')])], True, ref('stock.stock_location_components'))
 
61
    res = self.onchange_location_id(cr, uid, [], ref('stock.stock_location_14'), True, ref('stock.stock_location_components'))
56
62
    assert res.get('warning', False) != False , "Function 'onchange_location_id': Warning not raise. ('%s)" % res
57
63
 
58
64
-
 
65
  I will check that the function get_missing_locations does not return any locations.
 
66
-
 
67
  !python {model: stock.inventory}: |
 
68
    missing_loc_ids = self.get_missing_locations(cr, uid, [ref('inventory_exhaustive')], context=context)
 
69
    assert not missing_loc_ids, "get_missing_locations should not return IDs but returned %s" % missing_loc_ids
 
70
-
59
71
  I create a wizard record for stock_confirm_uninventoried_location and validate it
60
72
-
61
73
  !python {model: stock.inventory.uninventoried.locations}: |
88
100
  !python {model: stock.inventory}: |
89
101
    self.action_confirm(cr, uid, [ref('inventory_exhaustive')])
90
102
    inventory_state = self.read(cr, uid, [ref('inventory_exhaustive')], ['state'])[0]['state']
91
 
    assert inventory_state == 'confirm', "Exhaustive inventory have '%s' state. It should be 'confirm'" % inventory_state
 
103
    assert inventory_state == 'confirm', "Exhaustive inventory is in state '%s'. It should be 'confirm'" % inventory_state
92
104
 
93
105
-
94
106
  I will validate the exhaustive inventory
96
108
  !python {model: stock.inventory}: |
97
109
    self.action_done(cr, uid, [ref('inventory_exhaustive')])
98
110
    inventory_state = self.read(cr, uid, [ref('inventory_exhaustive')], ['state'])[0]['state']
99
 
    assert inventory_state == 'done', "Exhaustive inventory have '%s' state. It should be 'done'" % inventory_state
 
111
    assert inventory_state == 'done', "Exhaustive inventory is in state '%s'. It should be 'done'" % inventory_state
100
112
 
101
113
-
102
114
  I will verify the quantity for each products.