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

[officejs_test] Use mixin everywhere

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