Commit 6d88975c authored by Roque's avatar Roque

Appstore improvements tests

See merge request !20
parents c01627e0 ac6f831c
Pipeline #18509 passed with stage
in 0 seconds
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment