Commit 061f8459 authored by Romain Courteaud's avatar Romain Courteaud 🐙

[officejs_test] Use mixin everywhere

parent a78a2771
...@@ -29,20 +29,15 @@ ...@@ -29,20 +29,15 @@
import unittest import unittest
from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctionalTestCase from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctionalTestCase
from erp5.component.test.testOfficeJSAppstoreMixin import \
testOfficeJSAppstoreMixin
class TestOfficejSAppstoreUI(ERP5TypeFunctionalTestCase): class TestOfficejSAppstoreUI(testOfficeJSAppstoreMixin, ERP5TypeFunctionalTestCase):
foreground = 0 foreground = 0
run_only = "officejs_appstore_ui_zuite" run_only = "officejs_appstore_ui_zuite"
def getBusinessTemplateList(self):
return (
'officejs_base',
'officejs_test',
'officejs_security',
)
def afterSetUp(self): def afterSetUp(self):
super(TestOfficejSAppstoreUI, self).afterSetUp() testOfficeJSAppstoreMixin.afterSetUp(self)
self.portal.portal_preferences.getActiveSystemPreference().edit( self.portal.portal_preferences.getActiveSystemPreference().edit(
preferred_credential_alarm_automatic_call=1, preferred_credential_alarm_automatic_call=1,
preferred_credential_recovery_automatic_approval=1, preferred_credential_recovery_automatic_approval=1,
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
import random import random
import transaction import transaction
import unittest import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from Products.ERP5Type.tests.utils import DummyMailHost from Products.ERP5Type.tests.utils import DummyMailHost
from Products.ERP5Type.Utils import convertToUpperCase from Products.ERP5Type.Utils import convertToUpperCase
from AccessControl.SecurityManagement import getSecurityManager, \ from AccessControl.SecurityManagement import getSecurityManager, \
...@@ -38,7 +38,7 @@ from App.config import getConfiguration ...@@ -38,7 +38,7 @@ from App.config import getConfiguration
config = getConfiguration() config = getConfiguration()
class testOfficeJSAppstoreMixin(ERP5TypeTestCase): class testOfficeJSAppstoreMixin(SecurityTestCase):
abort_transaction = 0 abort_transaction = 0
...@@ -67,14 +67,6 @@ class testOfficeJSAppstoreMixin(ERP5TypeTestCase): ...@@ -67,14 +67,6 @@ class testOfficeJSAppstoreMixin(ERP5TypeTestCase):
self.portal.portal_alarms.subscribe() self.portal.portal_alarms.subscribe()
self.assertTrue(self.portal.portal_alarms.isSubscribed()) self.assertTrue(self.portal.portal_alarms.isSubscribed())
def _setUpDummyMailHost(self):
"""Do not play with NON persistent replacement of MailHost"""
ERP5TypeTestCase._setUpDummyMailHost(self)
def _restoreMailHost(self):
"""Do not play with NON persistent replacement of MailHost"""
ERP5TypeTestCase._restoreMailHost(self)
def beforeTearDown(self): def beforeTearDown(self):
self.deSetUpPersistentDummyMailHost() self.deSetUpPersistentDummyMailHost()
if self.abort_transaction: if self.abort_transaction:
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>testOfficeJSAppstoreMixin</string> </value> <value> <string>testOfficeJSAppstoreMixin</string> </value>
...@@ -49,13 +55,28 @@ ...@@ -49,13 +55,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <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> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -68,7 +89,7 @@ ...@@ -68,7 +89,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -77,7 +98,7 @@ ...@@ -77,7 +98,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from erp5.component.test.testOfficeJSAppstoreMixin import \
testOfficeJSAppstoreMixin
import time import time
from StringIO import StringIO from StringIO import StringIO
import zipfile import zipfile
...@@ -13,16 +14,10 @@ class LocalStringIO(StringIO): ...@@ -13,16 +14,10 @@ class LocalStringIO(StringIO):
StringIO.__init__(self, *args, **kw) StringIO.__init__(self, *args, **kw)
class TestOfficeJSScenario(SecurityTestCase): class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
def getTitle(self): def getTitle(self):
return "Test OfficeJS Scenario" return "Test OfficeJS Scenario"
def getBusinessTemplateList(self):
"""
Tuple of Business Templates we need to install
"""
return ('officejs_meta',)
def createNewUser(self, def createNewUser(self,
first_name="John_test", first_name="John_test",
last_name="Smith_test", last_name="Smith_test",
......
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple>
<string>W:113, 28: Unused variable \'api_path\' (unused-variable)</string> <string>W:108, 28: Unused variable \'api_path\' (unused-variable)</string>
<string>W:113, 38: Unused variable \'api_query\' (unused-variable)</string> <string>W:108, 38: Unused variable \'api_query\' (unused-variable)</string>
<string>W:113, 4: Unused variable \'api_scheme\' (unused-variable)</string> <string>W:108, 4: Unused variable \'api_scheme\' (unused-variable)</string>
<string>W:114, 6: Unused variable \'api_fragment\' (unused-variable)</string> <string>W:109, 6: Unused variable \'api_fragment\' (unused-variable)</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from erp5.component.test.testOfficeJSAppstoreMixin import \
testOfficeJSAppstoreMixin
import time import time
from StringIO import StringIO from StringIO import StringIO
import zipfile import zipfile
...@@ -11,16 +12,10 @@ class LocalStringIO(StringIO): ...@@ -11,16 +12,10 @@ class LocalStringIO(StringIO):
StringIO.__init__(self, *args, **kw) StringIO.__init__(self, *args, **kw)
class TestOfficeJSScenario(SecurityTestCase): class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
def getTitle(self): def getTitle(self):
return "Test OfficeJS Scenario Appstore" return "Test OfficeJS Scenario Appstore"
def getBusinessTemplateList(self):
"""
Tuple of Business Templates we need to install
"""
return ('officejs_meta', 'officejs_credential')
def createNewUser(self, def createNewUser(self,
first_name="John_test", first_name="John_test",
last_name="Smith_test", last_name="Smith_test",
......
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from erp5.component.test.testOfficeJSAppstoreMixin import \
testOfficeJSAppstoreMixin
import time import time
from StringIO import StringIO from StringIO import StringIO
import zipfile import zipfile
...@@ -13,16 +14,10 @@ class LocalStringIO(StringIO): ...@@ -13,16 +14,10 @@ class LocalStringIO(StringIO):
StringIO.__init__(self, *args, **kw) StringIO.__init__(self, *args, **kw)
class TestOfficeJSScenario(SecurityTestCase): class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
def getTitle(self): def getTitle(self):
return "Test OfficeJS Scenario" return "Test OfficeJS Scenario"
def getBusinessTemplateList(self):
"""
Tuple of Business Templates we need to install
"""
return ('officejs_meta',)
def createNewUser(self, def createNewUser(self,
first_name="John_test", first_name="John_test",
last_name="Smith_test", last_name="Smith_test",
......
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple>
<string>W:110, 28: Unused variable \'api_path\' (unused-variable)</string> <string>W:105, 28: Unused variable \'api_path\' (unused-variable)</string>
<string>W:110, 38: Unused variable \'api_query\' (unused-variable)</string> <string>W:105, 38: Unused variable \'api_query\' (unused-variable)</string>
<string>W:110, 4: Unused variable \'api_scheme\' (unused-variable)</string> <string>W:105, 4: Unused variable \'api_scheme\' (unused-variable)</string>
<string>W:111, 6: Unused variable \'api_fragment\' (unused-variable)</string> <string>W:106, 6: Unused variable \'api_fragment\' (unused-variable)</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -25,32 +25,18 @@ ...@@ -25,32 +25,18 @@
# #
############################################################################## ##############################################################################
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from erp5.component.test.testOfficeJSAppstoreMixin import \
testOfficeJSAppstoreMixin
#from unittest import expectedFailure #from unittest import expectedFailure
#from zLOG import LOG, INFO, ERROR #from zLOG import LOG, INFO, ERROR
import time import time
TEST_USER_BASE = "test_eos_user" TEST_USER_BASE = "test_eos_user"
class TestOfficeJSSecurity(SecurityTestCase): class TestOfficeJSSecurity(testOfficeJSAppstoreMixin):
def afterSetUp(self):
"""
This is ran before anything, used to set the environment
"""
pass
def beforeTearDown(self):
pass
def getTitle(self): def getTitle(self):
return "Test OfficeJS Security" return "Test OfficeJS Security"
def getBusinessTemplateList(self):
"""
Tuple of Business Templates we need to install
"""
return ('erp5_base',)
def checkNewMember(self, person, website_id="letitseed"): def checkNewMember(self, person, website_id="letitseed"):
self.assertEqual(repr(sorted(person.getCareerRoleList())), repr(["author"])) self.assertEqual(repr(sorted(person.getCareerRoleList())), repr(["author"]))
assignment, = person.searchFolder(portal_type="Assignment", validation_state="open") # not "opened"! assignment, = person.searchFolder(portal_type="Assignment", validation_state="open") # not "opened"!
......
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