'Helper method to send a shipment with id of send_id'

def send_shipment(self, user, send_id):

    db = current.db
    s3db = current.s3db
    stable = s3db.inv_send
    ititable = s3db.inv_track_item
    query = (stable.id == send_id)
    record = db(query).select(stable.status, limitby=(0, 1)).first()
    send_status = record.status
    query = (ititable.send_id == send_id)
    item_records = db(query).select(ititable.status)
    self.assertTrue((send_status == 0), 'Shipment    is    not    status    preparing')
    s3_debug('Shipment    status    is:    preparing')
    for rec in item_records:
        self.assertTrue((rec.status == 1), 'Shipment    item    is    not    status    preparing')
    s3_debug('Shipment    items    are    all    of    status:    preparing')
    self.login(account=user, nexturl=('inv/send_process/%s' % send_id))
    db.commit()
    query = (stable.id == send_id)
    record = db(query).select(stable.status, limitby=(0, 1)).first()
    send_status = record.status
    query = (ititable.send_id == send_id)
    item_records = db(query).select(ititable.status)
    self.assertTrue((send_status == 2), 'Shipment    is    not    status    sent')
    s3_debug('Shipment    status    is:    sent')
    for rec in item_records:
        self.assertTrue((rec.status == 2), 'Shipment    item    is    not    status    sent')
    s3_debug('Shipment    items    are    all    of    status:    sent')
