Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs-appstore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
officejs-appstore
Commits
cae3752e
Commit
cae3752e
authored
May 24, 2017
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[officejs_test] Add a basic scenario test
parent
df78d117
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
202 additions
and
1 deletion
+202
-1
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.py
...eItem/portal_components/test.erp5.testOfficeJSScenario.py
+77
-0
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.xml
...Item/portal_components/test.erp5.testOfficeJSScenario.xml
+123
-0
bt5/officejs_test/bt/template_test_id_list
bt5/officejs_test/bt/template_test_id_list
+2
-1
No files found.
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.py
0 → 100644
View file @
cae3752e
from
Products.ERP5Type.tests.SecurityTestCase
import
SecurityTestCase
import
time
from
StringIO
import
StringIO
import
zipfile
class
LocalStringIO
(
StringIO
):
__allow_access_to_unprotected_subobjects__
=
1
def
__init__
(
self
,
filename
,
*
args
,
**
kw
):
self
.
filename
=
filename
StringIO
.
__init__
(
self
,
*
args
,
**
kw
)
class
TestOfficeJSScenario
(
SecurityTestCase
):
def
getTitle
(
self
):
return
"Test OfficeJS Scenario"
def
getBusinessTemplateList
(
self
):
"""
Tuple of Business Templates we need to install
"""
return
(
'officejs_meta'
,)
def
createNewUser
(
self
,
first_name
=
"John_test"
,
last_name
=
"Smith_test"
,
reference
=
"TEST_OFFICEJS_"
,
email
=
"john.smith@test.com"
):
"""
Add new member using script for the website sign-in
"""
reference
+=
"%s"
%
time
.
time
()
user
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
"Person"
,
reference
=
reference
,
user_id
=
reference
,
first_name
=
first_name
,
last_name
=
last_name
,
default_email_coordinate_text
=
email
,
career_role_list
=
[
"author"
]
)
user
.
validate
()
assignment
=
user
.
newContent
(
portal_type
=
"Assignment"
,
role
=
"author"
)
assignment
.
open
()
return
user
def
test_01_user_can_contribute
(
self
):
###################################
### Manager: Create user
person
=
self
.
createNewUser
()
self
.
tic
()
###################################
### User: submit application
self
.
login
(
person
.
getUserId
())
import_file
=
LocalStringIO
(
'your.zip'
)
my_zip
=
zipfile
.
ZipFile
(
import_file
,
'w'
)
my_zip
.
writestr
(
'foo.txt'
,
'foobar'
)
my_zip
.
close
()
self
.
portal
.
ERP5Site_createNewSoftwarePublication
(
import_file
,
'software/application'
,
'My Foo App'
,
'My Bar version'
)
self
.
tic
()
###################################
### Alarm: extract zip file
self
.
login
()
self
.
portal
.
portal_alarms
.
officejs_process_submit_software_publication
\
.
activeSense
()
self
.
tic
()
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.xml
0 → 100644
View file @
cae3752e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testOfficeJSScenario
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testOfficeJSScenario
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/officejs_test/bt/template_test_id_list
View file @
cae3752e
test.erp5.testOfficeJSSecurity
test.erp5.testOfficeJSSecurity
\ No newline at end of file
test.erp5.testOfficeJSScenario
\ 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