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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
officejs-appstore
Commits
061f8459
Commit
061f8459
authored
Jan 23, 2019
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[officejs_test] Use mixin everywhere
parent
a78a2771
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
50 additions
and
71 deletions
+50
-71
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testFunctionalOfficeJSAppstoreUI.py
..._components/test.erp5.testFunctionalOfficeJSAppstoreUI.py
+4
-9
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSAppstoreMixin.py
.../portal_components/test.erp5.testOfficeJSAppstoreMixin.py
+2
-10
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSAppstoreMixin.xml
...portal_components/test.erp5.testOfficeJSAppstoreMixin.xml
+24
-3
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.py
...eItem/portal_components/test.erp5.testOfficeJSScenario.py
+3
-8
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.xml
...Item/portal_components/test.erp5.testOfficeJSScenario.xml
+4
-4
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenarioAppsore.py
...ortal_components/test.erp5.testOfficeJSScenarioAppsore.py
+3
-8
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenarioRjsUI.py
.../portal_components/test.erp5.testOfficeJSScenarioRjsUI.py
+3
-8
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenarioRjsUI.xml
...portal_components/test.erp5.testOfficeJSScenarioRjsUI.xml
+4
-4
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSSecurity.py
...eItem/portal_components/test.erp5.testOfficeJSSecurity.py
+3
-17
No files found.
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testFunctionalOfficeJSAppstoreUI.py
View file @
061f8459
...
@@ -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
,
...
...
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSAppstoreMixin.py
View file @
061f8459
...
@@ -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
ERP5Type
TestCase
from
Products.ERP5Type.tests.
SecurityTestCase
import
Security
TestCase
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
(
ERP5Type
TestCase
):
class
testOfficeJSAppstoreMixin
(
Security
TestCase
):
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
:
...
...
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSAppstoreMixin.xml
View file @
061f8459
...
@@ -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"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</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"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</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>
...
...
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.py
View file @
061f8459
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"
,
...
...
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenario.xml
View file @
061f8459
...
@@ -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:1
13
, 28: Unused variable \'api_path\' (unused-variable)
</string>
<string>
W:1
08
, 28: Unused variable \'api_path\' (unused-variable)
</string>
<string>
W:1
13
, 38: Unused variable \'api_query\' (unused-variable)
</string>
<string>
W:1
08
, 38: Unused variable \'api_query\' (unused-variable)
</string>
<string>
W:1
13
, 4: Unused variable \'api_scheme\' (unused-variable)
</string>
<string>
W:1
08
, 4: Unused variable \'api_scheme\' (unused-variable)
</string>
<string>
W:1
14
, 6: Unused variable \'api_fragment\' (unused-variable)
</string>
<string>
W:1
09
, 6: Unused variable \'api_fragment\' (unused-variable)
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
...
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenarioAppsore.py
View file @
061f8459
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"
,
...
...
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenarioRjsUI.py
View file @
061f8459
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"
,
...
...
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSScenarioRjsUI.xml
View file @
061f8459
...
@@ -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:1
10
, 28: Unused variable \'api_path\' (unused-variable)
</string>
<string>
W:1
05
, 28: Unused variable \'api_path\' (unused-variable)
</string>
<string>
W:1
10
, 38: Unused variable \'api_query\' (unused-variable)
</string>
<string>
W:1
05
, 38: Unused variable \'api_query\' (unused-variable)
</string>
<string>
W:1
10
, 4: Unused variable \'api_scheme\' (unused-variable)
</string>
<string>
W:1
05
, 4: Unused variable \'api_scheme\' (unused-variable)
</string>
<string>
W:1
11
, 6: Unused variable \'api_fragment\' (unused-variable)
</string>
<string>
W:1
06
, 6: Unused variable \'api_fragment\' (unused-variable)
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
...
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSSecurity.py
View file @
061f8459
...
@@ -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"!
...
...
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