Ejemplo n.º 1
0
    def setUp(self):
        self.prepare()
        meta.metadata.create_all(bind=self.engine)

        self.req = Requisition.create("2002-01-01 00:00:00", "Cars", "Engineering", "Adedayo Olukoya", "08033442234")
        self.user = User.create("deone", "dune369", "Dayo", "Osikoya", "Administrator")
        self.vendor = Vendor.create("Toyota Nigeria", "Isolo Way", "08023456789")
        self.item = Item.create("Corolla 09", "Vehicle")
        h.commit()
Ejemplo n.º 2
0
 def test_add_line_item(self):
     self.req.add_line_item("Corolla 09", "Vehicle", "2009 Model", 5, 3000000, 1)
     h.commit()
     res = Requisition.get(id=1)
     assert res.lineitems[0].name == "Corolla 09"
     assert res.lineitems[0].itemtype == "Vehicle"
     assert res.lineitems[0].specification == "2009 Model"
     assert res.lineitems[0].quantity == 5
     assert res.lineitems[0].unitprice == 3000000
     assert res.lineitems[0].vendorid == 1
Ejemplo n.º 3
0
    def test_approve(self):
        self.req.approve(1, 1)
        h.commit()

        assert self.req.approvedrequisition.requisitionid == self.req.id
        assert self.req.approvedrequisition.userid == self.user.id