Пример #1
0
 def POST(self):
     pdata = web.input(order_id=0, action=None)
     session = web.config._session
     if(session.roleid == 2):
         mess = ""
         if str(pdata.action) == "accept":
             accept_receipt(int(pdata.order_id))
             mess = update_status(int(pdata.order_id), status=1)
         else:
             mess = reject_receipt(int(pdata.order_id))
         return waiter.make_waiter_page(message = mess)
     else:
         pay_receipt(int(pdata.order_id))
         return print_receipt(int(pdata.order_id))
Пример #2
0
 def test_update_status(self):
     update_status(self.oid, 1)
     status = db.select('Orders', vars=dict(oid=self.oid), where='id=$oid', what='status')
     updStatus = status[0]
     self.assertEquals(updStatus.status, 1)