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
386e8f35
Commit
386e8f35
authored
May 24, 2017
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[officejs_test] Check web site rendering
parent
cae3752e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.py
...eItem/portal_components/test.erp5.testOfficeJSScenario.py
+27
-2
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.xml
...Item/portal_components/test.erp5.testOfficeJSScenario.xml
+6
-1
No files found.
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.py
View file @
386e8f35
...
...
@@ -2,6 +2,8 @@ from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
import
time
from
StringIO
import
StringIO
import
zipfile
import
httplib
import
urlparse
class
LocalStringIO
(
StringIO
):
...
...
@@ -45,6 +47,7 @@ class TestOfficeJSScenario(SecurityTestCase):
return
user
def
test_01_user_can_contribute
(
self
):
timestamp
=
"%s"
%
time
.
time
()
###################################
### Manager: Create user
person
=
self
.
createNewUser
()
...
...
@@ -52,26 +55,48 @@ class TestOfficeJSScenario(SecurityTestCase):
###################################
### User: submit application
self
.
logout
()
self
.
login
(
person
.
getUserId
())
import_file
=
LocalStringIO
(
'your.zip'
)
my_zip
=
zipfile
.
ZipFile
(
import_file
,
'w'
)
my_zip
.
writestr
(
'
foo.txt'
,
'foobar
'
)
my_zip
.
writestr
(
'
index.html'
,
'My super content
'
)
my_zip
.
close
()
version
=
'My Bar version %s'
%
timestamp
self
.
portal
.
ERP5Site_createNewSoftwarePublication
(
import_file
,
'software/application'
,
'My Foo App'
,
'My Bar version'
version
)
self
.
tic
()
###################################
### Alarm: extract zip file
self
.
logout
()
self
.
login
()
self
.
portal
.
portal_alarms
.
officejs_process_submit_software_publication
\
.
activeSense
()
self
.
tic
()
web_section
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Static Web Section'
,
title
=
version
)
###################################
### Anonymous: access the new application
self
.
logout
()
api_scheme
,
api_netloc
,
api_path
,
api_query
,
\
api_fragment
=
urlparse
.
urlsplit
(
self
.
portal
.
absolute_url
())
connection
=
httplib
.
HTTPConnection
(
api_netloc
)
connection
.
request
(
method
=
'GET'
,
url
=
'%s/'
%
web_section
.
absolute_url
()
)
response
=
connection
.
getresponse
()
self
.
assertEquals
(
response
.
read
(),
'My super content'
)
self
.
assertEquals
(
response
.
status
,
200
)
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.xml
View file @
386e8f35
...
...
@@ -45,7 +45,12 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
<tuple>
<string>
W: 91, 28: Unused variable \'api_path\' (unused-variable)
</string>
<string>
W: 91, 38: Unused variable \'api_query\' (unused-variable)
</string>
<string>
W: 91, 4: Unused variable \'api_scheme\' (unused-variable)
</string>
<string>
W: 92, 6: Unused variable \'api_fragment\' (unused-variable)
</string>
</tuple>
</value>
</item>
<item>
...
...
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