示例#1
0
 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"))
示例#2
0
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')
示例#3
0
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"))