def setUp(self): self.genBorrowReq = actUtils.createBorrowRequestAction( Tool.objects.get(name="Hoe"), profUtils.getProfileFromUsername("TaikhoomAttar")) self.genJoinReq = actUtils.createShedRequestAction( Shed.objects.get(name="Taikhoom's Shed"), profUtils.getProfileFromUsername("TaikhoomAttar"))
def borrow_tool(request, id): if request.user.is_anonymous(): return HttpResponseRedirect('/accounts/login') else: borrowerProfile = profileUtil.getProfileFromUser(request.user) toolObject = toolUtil.getToolFromID(id) ownerProfile = toolObject.owner actionObject = actionUtil.createBorrowRequestAction(toolObject, borrowerProfile) return HttpResponseRedirect('/tools/' + id + '/request_sent')
def borrow_tool(request, id): if request.user.is_anonymous(): return HttpResponseRedirect('/accounts/login') else: borrowerProfile = profileUtil.getProfileFromUser(request.user) toolObject = toolUtil.getToolFromID(id) ownerProfile = toolObject.owner actionObject = actionUtil.createBorrowRequestAction( toolObject, borrowerProfile) return HttpResponseRedirect('/tools/' + id + '/request_sent')
def setUp (self): self.genBorrowReq = actUtils.createBorrowRequestAction (Tool.objects.get (name = "Hoe"), profUtils.getProfileFromUsername ("TaikhoomAttar")) self.genJoinReq = actUtils.createShedRequestAction (Shed.objects.get (name = "Taikhoom's Shed"), profUtils.getProfileFromUsername ("TaikhoomAttar"))