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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
ab1a8420
Commit
ab1a8420
authored
Feb 28, 2012
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use getDocumentValue API to select the appropriate image to upload based on it's reference.
parent
e00cf198
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_uploadScreenshot.xml
...portal_skins/erp5_ui_test_core/Zuite_uploadScreenshot.xml
+12
-10
bt5/erp5_ui_test_core/bt/revision
bt5/erp5_ui_test_core/bt/revision
+1
-1
No files found.
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_uploadScreenshot.xml
View file @
ab1a8420
...
...
@@ -53,29 +53,31 @@
<value>
<string>
"""\n
Upload a screenshot taken by the test to ERP5\n
"""\n
global ms
g\n
msg = \'\'
\n
from Products.ERP5Type.Log import lo
g\n
\n
data_uri = context.REQUEST.form.get(\'data_uri\', \'default\')\n
\n
image = context.portal_catalog.getResultValue(reference=image_reference, \n
portal_type="Image")\n
image_module = getattr(context, "image_module", None)\n
if image_module is None:\n
return "erp5_dms is not Installed"\n
\n
image = image_module.getPortalObject().WebSection_getDocumentValue(\n
name=image_reference)\n
\n
if image is None:\n
# Image is an embedded file\n
if image is None
or image.getPortalType() != "Image"
:\n
# Image is an embedded file
or not an image
\n
return "Image: " + str(image_reference) + " not found"\n
\n
image.setContentType(\'image/png\')\n
data_text = data_uri.read()\n
msg += \'dataUri : \' + data_text + \'\\n\'\n
data = data_text.decode(\'base64\')\n
msg += \'data : \' + data + \'\\n\'
\n
\n
image.edit(data=data, \n
base_data=data,
\n
#base_data=data,
\n
filename=str(image_reference) + \'.png\', \n
content_type = \'image/png\')\n
\n
context.Zuite_updateImage(image)\n
msg += \'done\'\n
</string>
</value>
</item>
<item>
...
...
bt5/erp5_ui_test_core/bt/revision
View file @
ab1a8420
49
\ No newline at end of file
50
\ No newline at end of file
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