Beispiel #1
0
    def upload(self):
        """Upload a file to the zodb"""

        # keep diazo from touching this page
        self.request.response.setHeader('X-Theme-Disabled', 'True')
        context = IUpload(self.context)
        return context.upload()
Beispiel #2
0
    def upload(self):
        """Upload a file to the zodb"""

        # keep diazo from touching this page
        self.request.response.setHeader('X-Theme-Disabled', 'True')
        context = IUpload(self.context)
        return context.upload()
    def test_json_upload_image(self):
        self.portal.REQUEST['uploadfile'] = self._prepare_file('common_work.jpeg', type_='image/jpeg')
        self.portal.REQUEST['uploadtitle'] = 'foobar'
        self.portal.REQUEST['uploaddescription'] = 'foo'

        obj = IUpload(self.folder_object)
        msg = obj.upload()
        self.assertTrue('resolveuid/' in msg)
Beispiel #4
0
    def test_json_upload_image(self):
        self.portal.REQUEST['uploadfile'] = self._prepare_file('common_work.jpeg', type_='image/jpeg')
        self.portal.REQUEST['uploadtitle'] = 'foobar'
        self.portal.REQUEST['uploaddescription'] = 'foo'

        obj = IUpload(self.folder_object)
        msg = obj.upload()
        self.assertTrue('resolveuid/' in msg)
    def test_json_upload_not_allowed(self):
        self.portal.REQUEST['uploadfile'] = self._prepare_file()
        self.portal.REQUEST['uploadtitle'] = 'foobar'
        self.portal.REQUEST['uploaddescription'] = 'foo'

        obj = IUpload(self.folder_object)
        msg = obj.upload()

        self.assertTrue('resolveuid/' in msg)
    def test_json_upload_not_allowed(self):
        self.portal.REQUEST['uploadfile'] = self._prepare_file()
        self.portal.REQUEST['uploadtitle'] = 'foobar'
        self.portal.REQUEST['uploaddescription'] = 'foo'

        obj = IUpload(self.folder_object)
        msg = obj.upload()

        self.assertTrue('resolveuid/' in msg)
    def upload(self):
        """Upload a file to the zodb"""

        context = IUpload(self.context)
        return context.upload()
Beispiel #8
0
    def upload(self):
        """Upload a file to the zodb"""

        context = IUpload(self.context)
        return context.upload()
Beispiel #9
0
    def upload(self):
        """Upload a file to the zodb"""

        object = IUpload(self.context)
        return object.upload()
Beispiel #10
0
    def upload(self):
        """Upload a file to the zodb"""

        #context = aq_inner(self.context)
        object = IUpload(self.context)
        return object.upload()
Beispiel #11
0
    def upload(self):
        """Upload a file to the zodb"""

        object = IUpload(self.context)
        return object.upload()