web/test/unittest_web.py
changeset 9849 b18ef631e72c
parent 9601 e5a80bd337e8
child 9882 4db650d79e32
equal deleted inserted replaced
9848:ead7a288e08e 9849:b18ef631e72c
     1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
    62             self.skipTest('Python ``requests`` module is not available')
    62             self.skipTest('Python ``requests`` module is not available')
    63         super(FileUploadTC, self).setUp()
    63         super(FileUploadTC, self).setUp()
    64 
    64 
    65     @property
    65     @property
    66     def _post_url(self):
    66     def _post_url(self):
    67         return self.request().build_url('ajax', fname='fileupload')
    67         with self.admin_access.web_request() as req:
       
    68             return req.build_url('ajax', fname='fileupload')
    68 
    69 
    69     def _fobject(self, fname):
    70     def _fobject(self, fname):
    70         return open(join(self.datadir, fname), 'rb')
    71         return open(join(self.datadir, fname), 'rb')
    71 
    72 
    72     def _fcontent(self, fname):
    73     def _fcontent(self, fname):