'Helper method to add a track item to the inv_send with the
given send_id by the given user'

def track_send_item(self, user, send_id, data, removed=True):

    time.sleep(2)
    self.login(account=user, nexturl=('inv/send/%s/track_item' % send_id))
    try:
        add_btn = self.browser.find_element_by_id('show-add-btn')
        if add_btn.is_displayed():
            add_btn.click()
    except:
        pass
    table = 'inv_track_item'
    result = self.create(table, data, dbcallback=self.dbcallback_getStockLevels)
    if removed:
        qnty = 0
        for line in data:
            if (line[0] == 'quantity'):
                qnty = float(line[1])
                break
        stock_before = result['before'].records[(len(result['before']) - 1)].quantity
        stock_after = result['after'].records[(len(result['after']) - 1)].quantity
        stock_shipped = qnty
        self.assertTrue(((stock_before - stock_after) == stock_shipped), ('Warehouse    stock    not    properly    adjusted,    was    %s    should    be    %s    but    is    recorded    as    %s' % (stock_before, stock_after, (stock_before - stock_shipped))))
        s3_debug(('Stock    level    before    %s,    stock    level    after    %s' % (stock_before, stock_after)))
    return result
