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
ac6f831c
Commit
ac6f831c
authored
Jul 05, 2021
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs_test: test app publication reject
parent
c01627e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
6 deletions
+52
-6
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenarioAppstore.py
...rtal_components/test.erp5.testOfficeJSScenarioAppstore.py
+52
-6
No files found.
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenarioAppstore.py
View file @
ac6f831c
...
...
@@ -54,11 +54,7 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
assignment
.
open
()
return
user
def
createApplicationAndPublish
(
self
,
title
):
person_user
=
self
.
createNewUser
()
person_admin
=
self
.
createNewAdmin
()
self
.
tic
()
self
.
login
(
person_user
.
getUserId
())
def
createApplication
(
self
,
title
):
import_file
=
LocalStringIO
(
'app.zip'
)
my_zip
=
zipfile
.
ZipFile
(
import_file
,
'w'
)
my_zip
.
writestr
(
'index.html'
,
'<html><head><link rel="manifest" href="app_manifest.json"></head></html>'
)
...
...
@@ -69,9 +65,15 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
import_file
,
title
)
def
createApplicationAndPublish
(
self
,
title
):
person_user
=
self
.
createNewUser
()
person_admin
=
self
.
createNewAdmin
()
self
.
tic
()
self
.
login
(
person_user
.
getUserId
())
self
.
createApplication
(
title
)
self
.
logout
()
self
.
login
()
self
.
tic
()
self
.
portal
.
portal_alarms
.
officejs_process_submit_software_publication
\
.
activeSense
()
...
...
@@ -182,3 +184,47 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
self
.
assertEquals
(
software_product
.
getReference
(),
new_url
)
self
.
assertEquals
(
web_site
.
getRelativeUrl
(),
software_product
.
getFollowUp
(
portal_type
=
"Web Section"
))
def
test_appstore_reject_application
(
self
):
title
=
'My Application to be rejected %s'
%
time
.
time
()
self
.
assertEquals
(
self
.
getApplicationWithTitle
(
title
),
None
)
person_user
=
self
.
createNewUser
()
person_admin
=
self
.
createNewAdmin
()
self
.
tic
()
self
.
login
(
person_user
.
getUserId
())
self
.
createApplication
(
title
)
self
.
logout
()
self
.
login
()
self
.
tic
()
self
.
portal
.
portal_alarms
.
officejs_process_submit_software_publication
\
.
activeSense
()
self
.
tic
()
software_product
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Software Product'
,
title
=
title
)
web_site
=
software_product
.
SoftwareProduct_getRelatedWebSite
()
web_section
=
web_site
.
objectValues
()[
0
]
software_publication
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Software Publication'
,
reference
=
'SP-%s'
%
web_section
.
getId
()
)
software_release
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Software Release'
,
reference
=
web_section
.
getId
()
)
self
.
assertFalse
(
'Rejected'
in
web_section
.
getTitle
())
self
.
assertEquals
(
software_release
.
getValidationState
(),
"submitted"
)
software_publication
.
reject
()
self
.
tic
()
self
.
assertEquals
(
software_publication
.
getSimulationState
(),
"rejected"
)
self
.
assertEquals
(
software_release
.
getValidationState
(),
"cancelled"
)
self
.
assertTrue
(
'Rejected'
in
web_section
.
getTitle
())
self
.
logout
()
self
.
login
()
self
.
tic
()
\ 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