Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roque
erp5
Commits
af695afa
Commit
af695afa
authored
Aug 09, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webdav: add unit test for upload of embedded file
parent
1aa9dcfd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
product/ERP5/tests/testWebDavSupport.py
product/ERP5/tests/testWebDavSupport.py
+18
-0
No files found.
product/ERP5/tests/testWebDavSupport.py
View file @
af695afa
...
...
@@ -94,6 +94,24 @@ class TestWebDavSupport(ERP5TypeTestCase):
def
getWebPageModule
(
self
):
return
self
.
portal
.
getDefaultModule
(
'Web Page'
)
def
test_PUT_embedded_file
(
self
):
"""Test a file can be uploaded on a document allowing embedded files
"""
person
=
self
.
portal
.
person_module
.
newContent
()
transaction
.
commit
()
self
.
tic
()
file_object
=
makeFileUpload
(
'images/erp5_logo.png'
)
response
=
self
.
publish
(
person
.
getPath
()
+
'/erp5_logo.png'
,
request_method
=
'PUT'
,
stdin
=
file_object
,
basic
=
self
.
authentication
)
self
.
assertEqual
(
response
.
getStatus
(),
httplib
.
CREATED
)
image
=
person
[
'erp5_logo.png'
]
self
.
assertEqual
(
image
.
getPortalType
(),
'Embedded File'
)
self
.
assertEqual
(
image
.
getContentType
(),
'image/png'
)
file_object
.
seek
(
0
)
self
.
assertEqual
(
image
.
getData
(),
file_object
.
read
())
def
test_PUT_on_contributionTool
(
self
):
"""Test Portal Contribution through Webdav calls
Create a document
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment