Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
7f1a4034
Commit
7f1a4034
authored
10 years ago
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop support for Python < 2.7
parent
c70989a5
Changes
70
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
70 changed files
with
101 additions
and
557 deletions
+101
-557
bt5/erp5_configurator_maxma_demo/TestTemplateItem/portal_components/test.erp5.testMaxmaDemoConfigurationWorkflow.py
...omponents/test.erp5.testMaxmaDemoConfigurationWorkflow.py
+1
-1
bt5/erp5_configurator_standard/TestTemplateItem/portal_components/test.erp5.testStandardConfigurationWorkflow.py
...components/test.erp5.testStandardConfigurationWorkflow.py
+1
-1
bt5/erp5_json_style/SkinTemplateItem/portal_skins/erp5_json_style/ListBox_asHTML.xml
...plateItem/portal_skins/erp5_json_style/ListBox_asHTML.xml
+1
-1
bt5/erp5_tiosafe_oxatis_test/TestTemplateItem/testOxatisSynchronization.py
...oxatis_test/TestTemplateItem/testOxatisSynchronization.py
+1
-1
bt5/erp5_tiosafe_ubercart_test/TestTemplateItem/testUbercartSynchronisation.py
...cart_test/TestTemplateItem/testUbercartSynchronisation.py
+1
-1
bt5/erp5_tiosafe_virtuemart_test/TestTemplateItem/testVirtuemartSynchronization.py
...rt_test/TestTemplateItem/testVirtuemartSynchronization.py
+1
-2
bt5/erp5_web_shacache/TestTemplateItem/portal_components/test.erp5.testShaCache.py
...tTemplateItem/portal_components/test.erp5.testShaCache.py
+1
-1
bt5/erp5_web_shadir/TestTemplateItem/portal_components/test.erp5.testShaDir.py
...estTemplateItem/portal_components/test.erp5.testShaDir.py
+1
-1
bt5/networkcache_erp5/TestTemplateItem/portal_components/test.erp5.testShaCacheExternal.py
...eItem/portal_components/test.erp5.testShaCacheExternal.py
+1
-1
erp5/util/taskdistribution/__init__.py
erp5/util/taskdistribution/__init__.py
+1
-4
product/CMFActivity/tests/testCMFActivity.py
product/CMFActivity/tests/testCMFActivity.py
+0
-1
product/ERP5/Document/FloatEquivalenceTester.py
product/ERP5/Document/FloatEquivalenceTester.py
+3
-3
product/ERP5/tests/testAuthenticationPolicy.py
product/ERP5/tests/testAuthenticationPolicy.py
+0
-1
product/ERP5/tests/testAutoLogout.py
product/ERP5/tests/testAutoLogout.py
+0
-1
product/ERP5/tests/testBase.py
product/ERP5/tests/testBase.py
+1
-2
product/ERP5/tests/testBusinessTemplate.py
product/ERP5/tests/testBusinessTemplate.py
+1
-1
product/ERP5/tests/testCRM.py
product/ERP5/tests/testCRM.py
+1
-1
product/ERP5/tests/testCalendar.py
product/ERP5/tests/testCalendar.py
+2
-3
product/ERP5/tests/testDeliveryBuilderToSupportMultipleLines.py
...t/ERP5/tests/testDeliveryBuilderToSupportMultipleLines.py
+1
-1
product/ERP5/tests/testERP5Base.py
product/ERP5/tests/testERP5Base.py
+1
-1
product/ERP5/tests/testERP5Commerce.py
product/ERP5/tests/testERP5Commerce.py
+2
-3
product/ERP5/tests/testERP5Discussion.py
product/ERP5/tests/testERP5Discussion.py
+0
-1
product/ERP5/tests/testERP5Interfaces.py
product/ERP5/tests/testERP5Interfaces.py
+1
-1
product/ERP5/tests/testERP5Web.py
product/ERP5/tests/testERP5Web.py
+1
-1
product/ERP5/tests/testExternalAccount.py
product/ERP5/tests/testExternalAccount.py
+0
-1
product/ERP5/tests/testInventory.py
product/ERP5/tests/testInventory.py
+1
-1
product/ERP5/tests/testInventoryAPI.py
product/ERP5/tests/testInventoryAPI.py
+1
-1
product/ERP5/tests/testKM.py
product/ERP5/tests/testKM.py
+1
-1
product/ERP5/tests/testMRP.py
product/ERP5/tests/testMRP.py
+1
-1
product/ERP5/tests/testOpenOrder.py
product/ERP5/tests/testOpenOrder.py
+1
-1
product/ERP5/tests/testResource.py
product/ERP5/tests/testResource.py
+1
-1
product/ERP5/tests/testSupply.py
product/ERP5/tests/testSupply.py
+0
-1
product/ERP5/tests/testTaskReportDivergence.py
product/ERP5/tests/testTaskReportDivergence.py
+1
-2
product/ERP5/tests/testTemplate.py
product/ERP5/tests/testTemplate.py
+1
-1
product/ERP5/tests/testTradeModelLine.py
product/ERP5/tests/testTradeModelLine.py
+1
-1
product/ERP5/tests/testTranslation.py
product/ERP5/tests/testTranslation.py
+0
-1
product/ERP5/tests/testWebDavSupport.py
product/ERP5/tests/testWebDavSupport.py
+1
-1
product/ERP5/tests/utils.py
product/ERP5/tests/utils.py
+1
-2
product/ERP5Catalog/tests/testERP5Catalog.py
product/ERP5Catalog/tests/testERP5Catalog.py
+1
-2
product/ERP5Form/tests/testPreferences.py
product/ERP5Form/tests/testPreferences.py
+1
-1
product/ERP5Form/tests/testProxyField.py
product/ERP5Form/tests/testProxyField.py
+1
-1
product/ERP5Form/tests/testSelectionTool.py
product/ERP5Form/tests/testSelectionTool.py
+1
-1
product/ERP5OOo/tests/testDms.py
product/ERP5OOo/tests/testDms.py
+1
-1
product/ERP5OOo/tests/testFormPrintoutAsODG.py
product/ERP5OOo/tests/testFormPrintoutAsODG.py
+0
-1
product/ERP5OOo/tests/testFormPrintoutAsODT.py
product/ERP5OOo/tests/testFormPrintoutAsODT.py
+1
-1
product/ERP5OOo/tests/testIngestion.py
product/ERP5OOo/tests/testIngestion.py
+1
-1
product/ERP5OOo/tests/testOOoDynamicStyle.py
product/ERP5OOo/tests/testOOoDynamicStyle.py
+0
-1
product/ERP5SyncML/tests/testERP5DocumentSyncML.py
product/ERP5SyncML/tests/testERP5DocumentSyncML.py
+1
-1
product/ERP5SyncML/tests/testERP5SyncML.py
product/ERP5SyncML/tests/testERP5SyncML.py
+1
-1
product/ERP5TioSafe/tests/testProductERP5Synchronization.py
product/ERP5TioSafe/tests/testProductERP5Synchronization.py
+0
-1
product/ERP5Type/ConnectionPlugin/TimeoutTransport.py
product/ERP5Type/ConnectionPlugin/TimeoutTransport.py
+2
-4
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+10
-10
product/ERP5Type/__init__.py
product/ERP5Type/__init__.py
+0
-1
product/ERP5Type/collections.py
product/ERP5Type/collections.py
+0
-31
product/ERP5Type/patches/ExternalMethod.py
product/ERP5Type/patches/ExternalMethod.py
+4
-1
product/ERP5Type/patches/_transaction.py
product/ERP5Type/patches/_transaction.py
+2
-2
product/ERP5Type/patches/python.py
product/ERP5Type/patches/python.py
+0
-11
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
+1
-2
product/ERP5Type/tests/ProcessingNodeTestCase.py
product/ERP5Type/tests/ProcessingNodeTestCase.py
+1
-2
product/ERP5Type/tests/backportUnittest.py
product/ERP5Type/tests/backportUnittest.py
+25
-271
product/ERP5Type/tests/runFunctionalTest.py
product/ERP5Type/tests/runFunctionalTest.py
+1
-1
product/ERP5Type/tests/runTestSuite.py
product/ERP5Type/tests/runTestSuite.py
+1
-1
product/ERP5Type/tests/runUnitTest.py
product/ERP5Type/tests/runUnitTest.py
+3
-6
product/ERP5Type/tests/testBackportUnittest.py
product/ERP5Type/tests/testBackportUnittest.py
+0
-139
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+1
-1
product/ERP5Type/tests/testERP5Type.py
product/ERP5Type/tests/testERP5Type.py
+1
-1
product/ERP5Type/tests/testERP5TypeInterfaces.py
product/ERP5Type/tests/testERP5TypeInterfaces.py
+1
-2
product/ERP5Type/tests/utils.py
product/ERP5Type/tests/utils.py
+2
-4
product/HBTreeFolder2/tests/testHBTreeFolder2.py
product/HBTreeFolder2/tests/testHBTreeFolder2.py
+1
-1
product/ZSQLCatalog/tests/testSQLCatalog.py
product/ZSQLCatalog/tests/testSQLCatalog.py
+1
-2
No files found.
bt5/erp5_configurator_maxma_demo/TestTemplateItem/portal_components/test.erp5.testMaxmaDemoConfigurationWorkflow.py
View file @
7f1a4034
...
...
@@ -28,7 +28,7 @@
from
Products.ERP5Configurator.tests.ConfiguratorTestMixin
import
\
TestLiveConfiguratorWorkflowMixin
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
Products.ERP5Type.tests.backportU
nittest
import
expectedFailure
from
u
nittest
import
expectedFailure
class
TestMaxmaDemoConfiguratorWorkflow
(
TestLiveConfiguratorWorkflowMixin
):
"""
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_configurator_standard/TestTemplateItem/portal_components/test.erp5.testStandardConfigurationWorkflow.py
View file @
7f1a4034
...
...
@@ -29,9 +29,9 @@
import
os
from
unittest
import
expectedFailure
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5Type.tests.runUnitTest
import
tests_home
from
Products.ERP5Type.tests.utils
import
FileUpload
from
Products.ERP5Configurator.tests.ConfiguratorTestMixin
import
\
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_json_style/SkinTemplateItem/portal_skins/erp5_json_style/ListBox_asHTML.xml
View file @
7f1a4034
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from
Products.ERP5Type.
collections import OrderedDict\n
<value>
<string>
from collections import OrderedDict\n
from json import dumps\n
label_list = context.getLabelValueList()\n
num = len(label_list)\n
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_tiosafe_oxatis_test/TestTemplateItem/testOxatisSynchronization.py
View file @
7f1a4034
...
...
@@ -28,10 +28,10 @@
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
import
unittest
from
unittest
import
expectedFailure
from
zLOG
import
LOG
from
Testing
import
ZopeTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestOxatisSynchronization
(
ERP5TypeTestCase
):
"""
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_tiosafe_ubercart_test/TestTemplateItem/testUbercartSynchronisation.py
View file @
7f1a4034
...
...
@@ -28,11 +28,11 @@
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
import
unittest
from
unittest
import
expectedFailure
from
zLOG
import
LOG
from
Testing
import
ZopeTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
import
os
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestUbercartSynchronization
(
ERP5TypeTestCase
):
"""
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_tiosafe_virtuemart_test/TestTemplateItem/testVirtuemartSynchronization.py
View file @
7f1a4034
...
...
@@ -28,13 +28,12 @@
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
import
unittest
from
unittest
import
expectedFailure
from
zLOG
import
LOG
from
Testing
import
ZopeTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
import
os
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestVirtuemartSynchronization
(
ERP5TypeTestCase
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_web_shacache/TestTemplateItem/portal_components/test.erp5.testShaCache.py
View file @
7f1a4034
...
...
@@ -30,9 +30,9 @@
import
httplib
import
urlparse
from
unittest
import
expectedFailure
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
erp5.component.test.ShaCacheMixin
import
ShaCacheMixin
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestShaCache
(
ShaCacheMixin
,
ERP5TypeTestCase
):
"""
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_web_shadir/TestTemplateItem/portal_components/test.erp5.testShaDir.py
View file @
7f1a4034
...
...
@@ -32,9 +32,9 @@ import httplib
import
urlparse
import
json
import
random
from
unittest
import
expectedFailure
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
erp5.component.test.ShaDirMixin
import
ShaDirMixin
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestShaDir
(
ShaDirMixin
,
ERP5TypeTestCase
):
"""
...
...
This diff is collapsed.
Click to expand it.
bt5/networkcache_erp5/TestTemplateItem/portal_components/test.erp5.testShaCacheExternal.py
View file @
7f1a4034
...
...
@@ -30,11 +30,11 @@
import
base64
import
httplib
from
unittest
import
expectedFailure
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
erp5.component.test.ShaCacheMixin
import
ShaCacheMixin
from
erp5.component.test.ShaSecurityMixin
import
ShaSecurityMixin
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestShaCacheExternal
(
ShaCacheMixin
,
ShaSecurityMixin
,
ERP5TypeTestCase
):
"""
...
...
This diff is collapsed.
Click to expand it.
erp5/util/taskdistribution/__init__.py
View file @
7f1a4034
...
...
@@ -382,10 +382,7 @@ class ServerProxy(xmlrpclib.ServerProxy):
transport
=
self
.
__transport
def
make_connection
(
*
args
,
**
kw
):
conn
=
transport
.
__class__
.
make_connection
(
transport
,
*
args
,
**
kw
)
# BBB: On Python < 2.7, HTTP connection is wrapped
c
=
getattr
(
conn
,
'_conn'
,
conn
)
assert
hasattr
(
c
,
'timeout'
)
c
.
timeout
=
120
conn
.
timeout
=
120
return
conn
transport
.
make_connection
=
make_connection
self
.
__rpc_lock
=
threading
.
Lock
()
...
...
This diff is collapsed.
Click to expand it.
product/CMFActivity/tests/testCMFActivity.py
View file @
7f1a4034
...
...
@@ -30,7 +30,6 @@ import inspect
import
unittest
from
Products.ERP5Type.tests.utils
import
LogInterceptor
from
Products.ERP5Type.tests.backportUnittest
import
skip
from
Testing
import
ZopeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/Document/FloatEquivalenceTester.py
View file @
7f1a4034
...
...
@@ -35,9 +35,9 @@ from Products.ERP5Type.Core.Predicate import Predicate
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5.mixin.equivalence_tester
import
EquivalenceTesterMixin
ROUNDING_OPTION_DICT
=
dict
((
name
,
value
)
for
name
,
value
in
decimal
.
__dict__
.
items
()
if
name
.
startswith
(
'ROUND_'
))
ROUNDING_OPTION_DICT
=
{
name
:
value
for
name
,
value
in
decimal
.
__dict__
.
items
()
if
name
.
startswith
(
'ROUND_'
)}
# XXX: We could compute a value based on sys.float_info.epsilon
DEFAULT_PRECISION
=
1e-12
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testAuthenticationPolicy.py
View file @
7f1a4034
...
...
@@ -31,7 +31,6 @@
import
unittest
import
time
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.Formulator.Errors
import
ValidationError
from
Products.ERP5Type.Document
import
newTempBase
from
DateTime
import
DateTime
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testAutoLogout.py
View file @
7f1a4034
...
...
@@ -31,7 +31,6 @@
import
unittest
import
time
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
DateTime
import
DateTime
class
TestAuoLogout
(
ERP5TypeTestCase
):
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testBase.py
View file @
7f1a4034
...
...
@@ -30,7 +30,7 @@
import
unittest
import
os
from
unittest
import
skip
from
Testing
import
ZopeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
,
\
...
...
@@ -41,7 +41,6 @@ from Products.ERP5Type.tests.Sequence import SequenceList
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.Utils
import
convertToUpperCase
from
zExceptions
import
BadRequest
from
Products.ERP5Type.tests.backportUnittest
import
skip
from
Products.ERP5Type.Workflow
import
addWorkflowByType
from
Products.CMFCore.WorkflowCore
import
WorkflowException
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testBusinessTemplate.py
View file @
7f1a4034
...
...
@@ -29,6 +29,7 @@
import
unittest
import
logging
from
unittest
import
expectedFailure
,
skip
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Acquisition
import
aq_base
...
...
@@ -40,7 +41,6 @@ from Products.ERP5Type.Globals import PersistentMapping
from
Products.CMFCore.Expression
import
Expression
from
Products.ERP5Type.tests.utils
import
LogInterceptor
from
Products.ERP5Type.Workflow
import
addWorkflowByType
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
,
skip
from
Products.ERP5VCS.WorkingCopy
import
getVcsTool
import
shutil
import
os
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testCRM.py
View file @
7f1a4034
...
...
@@ -29,6 +29,7 @@
import
unittest
import
os
import
textwrap
from
unittest
import
expectedFailure
from
Products.CMFCore.WorkflowCore
import
WorkflowException
from
Products.ERP5Type.tests.utils
import
FileUpload
...
...
@@ -36,7 +37,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase,\
_getConversionServerDict
from
Products.ERP5OOo.tests.testIngestion
import
FILENAME_REGULAR_EXPRESSION
from
Products.ERP5OOo.tests.testIngestion
import
REFERENCE_REGULAR_EXPRESSION
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
email.header
import
decode_header
from
email.mime.multipart
import
MIMEMultipart
from
email.mime.base
import
MIMEBase
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testCalendar.py
View file @
7f1a4034
...
...
@@ -26,12 +26,13 @@
#
##############################################################################
import
unittest
from
unittest
import
skip
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5ReportTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.backportUnittest
import
skip
class
TestCalendar
(
ERP5ReportTestCase
):
...
...
@@ -1502,8 +1503,6 @@ class TestCalendar(ERP5ReportTestCase):
'calendar_period_type/type3'
:
1.5
,})
import
unittest
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestCalendar
))
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testDeliveryBuilderToSupportMultipleLines.py
View file @
7f1a4034
...
...
@@ -27,13 +27,13 @@
##############################################################################
import
unittest
from
unittest
import
expectedFailure
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5.tests.testInvoice
import
TestSaleInvoiceMixin
from
Products.ERP5.tests.utils
import
newSimulationExpectedFailure
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestNestedLineMixin
(
TestSaleInvoiceMixin
):
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testERP5Base.py
View file @
7f1a4034
...
...
@@ -29,6 +29,7 @@
import
os
import
unittest
from
unittest
import
expectedFailure
from
DateTime
import
DateTime
from
Products.ERP5Type.Utils
import
convertToUpperCase
...
...
@@ -36,7 +37,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
,
FileUpload
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestERP5Base
(
ERP5TypeTestCase
):
"""ERP5 Base tests.
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testERP5Commerce.py
View file @
7f1a4034
...
...
@@ -29,11 +29,12 @@
import
os
import
string
import
unittest
import
urllib
from
unittest
import
skip
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
FileUpload
from
Products.ERP5Type.tests.backportUnittest
import
skip
SESSION_ID
=
"12345678"
LANGUAGE_LIST
=
(
'en'
,
'fr'
,
'de'
,
'bg'
,)
...
...
@@ -937,8 +938,6 @@ class TestCommerce(ERP5TypeTestCase):
sale_order_object_list
=
self
.
portal
.
sale_order_module
.
contentValues
()
self
.
assertEqual
(
comment
,
sale_order_object_list
[
0
].
getComment
())
import
unittest
def
test_suite
():
suite
=
unittest
.
TestSuite
()
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testERP5Discussion.py
View file @
7f1a4034
...
...
@@ -32,7 +32,6 @@
import
unittest
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5OOo.tests.testDms
import
makeFileUpload
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testERP5Interfaces.py
View file @
7f1a4034
...
...
@@ -28,7 +28,7 @@
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.testERP5TypeInterfaces
import
addTestMethodDynamically
from
Products.ERP5Type.tests.backportU
nittest
import
expectedFailure
from
u
nittest
import
expectedFailure
import
unittest
# this list can be generated automatically using introspection or can be set
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testERP5Web.py
View file @
7f1a4034
...
...
@@ -30,6 +30,7 @@
import
re
import
unittest
from
unittest
import
expectedFailure
,
skip
from
AccessControl
import
Unauthorized
from
Testing
import
ZopeTestCase
from
DateTime
import
DateTime
...
...
@@ -37,7 +38,6 @@ from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
DummyLocalizer
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
,
skip
LANGUAGE_LIST
=
(
'en'
,
'fr'
,
'de'
,
'bg'
,
)
HTTP_OK
=
200
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testExternalAccount.py
View file @
7f1a4034
...
...
@@ -31,7 +31,6 @@
import
unittest
import
time
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.Formulator.Errors
import
ValidationError
from
Products.ERP5Type.Document
import
newTempBase
from
DateTime
import
DateTime
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testInventory.py
View file @
7f1a4034
...
...
@@ -40,6 +40,7 @@
import
unittest
from
unittest
import
expectedFailure
from
Products.ERP5Type.Utils
import
cartesianProduct
from
copy
import
copy
...
...
@@ -51,7 +52,6 @@ from zLOG import LOG
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
Products.ERP5Type.DateUtils
import
addToDate
from
Products.ERP5.tests.testOrder
import
TestOrderMixin
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5Form.Selection
import
DomainSelection
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
textwrap
import
dedent
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testInventoryAPI.py
View file @
7f1a4034
...
...
@@ -35,6 +35,7 @@ TODO: test variation
import
os
import
random
import
unittest
from
unittest
import
expectedFailure
from
AccessControl.SecurityManagement
import
newSecurityManager
from
DateTime
import
DateTime
...
...
@@ -42,7 +43,6 @@ from MySQLdb import ProgrammingError
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
reindex
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5.Tool.SimulationTool
import
MYSQL_MIN_DATETIME_RESOLUTION
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testKM.py
View file @
7f1a4034
...
...
@@ -28,10 +28,10 @@
##############################################################################
import
unittest
from
unittest
import
expectedFailure
from
Testing
import
ZopeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5Type.Base
import
TempBase
from
Products.ERP5OOo.tests.testDms
import
makeFileUpload
,
TestDocumentMixin
,
TestDocument
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testMRP.py
View file @
7f1a4034
...
...
@@ -27,6 +27,7 @@
##############################################################################
import
unittest
from
unittest
import
skip
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
DateTime
import
DateTime
...
...
@@ -35,7 +36,6 @@ from Products.CMFCore.utils import getToolByName
from
Products.ERP5Type.tests.utils
import
reindex
from
Products.ERP5.tests.testBPMCore
import
TestBPMMixin
from
Products.ERP5Type.tests.backportUnittest
import
skip
from
Products.ERP5.tests.utils
import
newSimulationExpectedFailure
class
TestMRPMixin
(
TestBPMMixin
):
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testOpenOrder.py
View file @
7f1a4034
...
...
@@ -27,8 +27,8 @@
import
unittest
import
os
import
time
from
unittest
import
expectedFailure
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
DateTime
import
DateTime
# explicitly set Europe/Paris timezone
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testResource.py
View file @
7f1a4034
...
...
@@ -27,13 +27,13 @@
##############################################################################
import
unittest
from
unittest
import
expectedFailure
from
Testing
import
ZopeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
from
zLOG
import
LOG
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestResource
(
ERP5TypeTestCase
):
"""
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testSupply.py
View file @
7f1a4034
...
...
@@ -33,7 +33,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
reindex
from
Products.ERP5Type.tests.utils
import
SubcontentReindexingWrapper
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
import
transaction
class
TestSupplyMixin
:
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testTaskReportDivergence.py
View file @
7f1a4034
...
...
@@ -27,12 +27,11 @@
##############################################################################
import
unittest
from
unittest
import
expectedFailure
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
testTask
import
TestTaskMixin
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5.tests.utils
import
newSimulationExpectedFailure
from
Products.ERP5Type.tests.SecurityTestCase
import
SecurityTestCase
class
TestTaskReportDivergenceMixin
(
TestTaskMixin
,
SecurityTestCase
):
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testTemplate.py
View file @
7f1a4034
...
...
@@ -30,9 +30,9 @@
"""Tests Template functionality"""
import
unittest
from
unittest
import
expectedFailure
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Form.PreferenceTool
import
Priority
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testTradeModelLine.py
View file @
7f1a4034
...
...
@@ -31,12 +31,12 @@
from
UserDict
import
UserDict
import
random
import
unittest
from
unittest
import
expectedFailure
from
Products.ERP5.tests.testBPMCore
import
TestBPMMixin
from
Products.ERP5Type.Base
import
Base
from
Products.ERP5Type.Utils
import
simple_decorator
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
,
updateCellList
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testTranslation.py
View file @
7f1a4034
...
...
@@ -34,7 +34,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
to_utf8
from
Products.ERP5Type.Utils
import
getMessageIdWithContext
from
zLOG
import
LOG
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
# dependency order
target_business_templates
=
(
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testWebDavSupport.py
View file @
7f1a4034
...
...
@@ -38,7 +38,7 @@ from Testing import ZopeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
DummyLocalizer
,
\
createZODBPythonScript
,
FileUpload
from
Products.ERP5Type.tests.backportU
nittest
import
expectedFailure
from
u
nittest
import
expectedFailure
import
httplib
from
StringIO
import
StringIO
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/tests/utils.py
View file @
7f1a4034
...
...
@@ -37,8 +37,7 @@ from OFS.XMLExportImport import importXML
if
int
(
os
.
environ
.
get
(
'erp5_report_new_simulation_failures'
)
or
0
):
newSimulationExpectedFailure
=
lambda
test
:
test
else
:
from
Products.ERP5Type.tests.backportUnittest
import
\
expectedFailure
as
newSimulationExpectedFailure
from
unittest
import
expectedFailure
as
newSimulationExpectedFailure
# Keep a global reference to a ZODB storage so that we can import business
# template xml files. XXX this connection will remain open.
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Catalog/tests/testERP5Catalog.py
View file @
7f1a4034
...
...
@@ -29,6 +29,7 @@
import
unittest
import
sys
from
unittest
import
expectedFailure
from
_mysql_exceptions
import
ProgrammingError
from
Testing
import
ZopeTestCase
...
...
@@ -40,12 +41,10 @@ from DateTime import DateTime
from
Products.ERP5Type.tests.utils
import
LogInterceptor
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
,
todo_erp5
,
\
getExtraSqlConnectionStringList
from
Products.ERP5Type.tests.backportUnittest
import
skip
from
Products.ZSQLCatalog.ZSQLCatalog
import
HOT_REINDEXING_FINISHED_STATE
,
\
HOT_REINDEXING_RECORDING_STATE
,
HOT_REINDEXING_DOUBLE_INDEXING_STATE
from
Products.CMFActivity.Errors
import
ActivityFlushError
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
ComplexQuery
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
OFS.ObjectManager
import
ObjectManager
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Form/tests/testPreferences.py
View file @
7f1a4034
...
...
@@ -29,6 +29,7 @@
##############################################################################
import
unittest
from
unittest
import
expectedFailure
from
AccessControl.SecurityManagement
import
noSecurityManager
from
AccessControl.SecurityManagement
import
getSecurityManager
...
...
@@ -36,7 +37,6 @@ from zExceptions import Unauthorized
from
AccessControl.ZopeGuards
import
guarded_hasattr
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5Type.tests.testERP5Type
import
PropertySheetTestCase
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Form.PreferenceTool
import
Priority
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Form/tests/testProxyField.py
View file @
7f1a4034
...
...
@@ -34,7 +34,7 @@ from Products.Formulator.FormToXML import formToXML
from
Products.Formulator.TALESField
import
TALESMethod
import
unittest
from
lxml
import
etree
from
Products.ERP5Type.tests.backportU
nittest
import
expectedFailure
from
u
nittest
import
expectedFailure
class
TestProxyField
(
ERP5TypeTestCase
):
"""
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Form/tests/testSelectionTool.py
View file @
7f1a4034
...
...
@@ -29,6 +29,7 @@
import
unittest
from
threading
import
Thread
from
thread
import
get_ident
from
unittest
import
skip
import
transaction
import
ZODB
...
...
@@ -37,7 +38,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Form.Selection
import
Selection
from
Products.ERP5Form.Tool.SelectionTool
import
SelectionTool
from
Products.ERP5Type.tests.backportUnittest
import
skip
class
TestSelectionTool
(
ERP5TypeTestCase
):
...
...
This diff is collapsed.
Click to expand it.
product/ERP5OOo/tests/testDms.py
View file @
7f1a4034
...
...
@@ -50,6 +50,7 @@ import time
import
StringIO
from
subprocess
import
Popen
,
PIPE
from
cgi
import
FieldStorage
from
unittest
import
expectedFailure
import
ZPublisher.HTTPRequest
from
Testing
import
ZopeTestCase
...
...
@@ -74,7 +75,6 @@ import difflib
import
re
from
AccessControl
import
Unauthorized
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
DateTime
import
DateTime
QUIET
=
0
...
...
This diff is collapsed.
Click to expand it.
product/ERP5OOo/tests/testFormPrintoutAsODG.py
View file @
7f1a4034
...
...
@@ -30,7 +30,6 @@
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5OOo.tests.TestFormPrintoutMixin
import
TestFormPrintoutMixin
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5OOo.OOoUtils
import
OOoBuilder
from
Products.ERP5OOo.tests.utils
import
Validator
from
Products.ERP5Type.tests.utils
import
FileUpload
...
...
This diff is collapsed.
Click to expand it.
product/ERP5OOo/tests/testFormPrintoutAsODT.py
View file @
7f1a4034
...
...
@@ -30,8 +30,8 @@
##############################################################################
import
unittest
from
unittest
import
skip
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.backportUnittest
import
skip
from
Products.ERP5OOo.tests.TestFormPrintoutMixin
import
TestFormPrintoutMixin
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.MimetypesRegistry.mime_types.magic
import
guessMime
...
...
This diff is collapsed.
Click to expand it.
product/ERP5OOo/tests/testIngestion.py
View file @
7f1a4034
...
...
@@ -45,7 +45,7 @@ from Products.ERP5OOo.OOoUtils import OOoBuilder
from
zLOG
import
LOG
,
INFO
,
ERROR
from
Products.CMFCore.utils
import
getToolByName
from
zExceptions
import
BadRequest
from
Products.ERP5Type.tests.backportU
nittest
import
expectedFailure
from
u
nittest
import
expectedFailure
import
urllib
import
urllib2
import
httplib
...
...
This diff is collapsed.
Click to expand it.
product/ERP5OOo/tests/testOOoDynamicStyle.py
View file @
7f1a4034
...
...
@@ -32,7 +32,6 @@ import sys
import
unittest
from
cStringIO
import
StringIO
from
zipfile
import
ZipFile
from
Products.ERP5Type.tests.backportUnittest
import
skip
from
Products.ERP5Type.tests.utils
import
FileUpload
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
...
...
This diff is collapsed.
Click to expand it.
product/ERP5SyncML/tests/testERP5DocumentSyncML.py
View file @
7f1a4034
...
...
@@ -29,6 +29,7 @@
import
os
from
base64
import
b16encode
from
unittest
import
expectedFailure
import
unittest
from
AccessControl.SecurityManagement
import
newSecurityManager
...
...
@@ -39,7 +40,6 @@ from Products.ERP5Type.tests.utils import FileUpload
from
Products.ERP5SyncML.Tool
import
SynchronizationTool
from
Products.ERP5SyncML.tests.testERP5SyncML
import
TestERP5SyncMLMixin
from
Products.ERP5SyncML.Document
import
SyncMLSubscription
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
test_files
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'test_document'
)
FILENAME_REGULAR_EXPRESSION
=
"(?P<reference>[A-Z]{3,10})-
\
...
...
This diff is collapsed.
Click to expand it.
product/ERP5SyncML/tests/testERP5SyncML.py
View file @
7f1a4034
...
...
@@ -30,6 +30,7 @@
import
unittest
from
base64
import
b64encode
,
b64decode
,
b16encode
from
lxml
import
etree
from
unittest
import
expectedFailure
from
AccessControl.SecurityManagement
import
newSecurityManager
from
ERP5Diff
import
ERP5Diff
...
...
@@ -43,7 +44,6 @@ from Products.ERP5SyncML.SyncMLConstant import MAX_LEN
from
Products.ERP5SyncML.Document
import
SyncMLSubscription
from
Products.ERP5SyncML.tests.testERP5SyncMLMixin
import
TestERP5SyncMLMixin
\
as
TestMixin
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestERP5SyncMLMixin
(
TestMixin
):
...
...
This diff is collapsed.
Click to expand it.
product/ERP5TioSafe/tests/testProductERP5Synchronization.py
View file @
7f1a4034
...
...
@@ -28,7 +28,6 @@
##############################################################################
from
Products.ERP5TioSafe.tests.testPrestashopMixin
import
testPrestashopMixin
from
Products.ERP5Type.tests.backportUnittest
import
skip
class
TestProductERP5Synchronization
(
testPrestashopMixin
):
""" This class allows to check different cases of Product's sync. """
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/ConnectionPlugin/TimeoutTransport.py
View file @
7f1a4034
...
...
@@ -40,8 +40,7 @@ class TimeoutTransport(SafeTransport):
def
make_connection
(
*
args
,
**
kw
):
connection
=
transport_class
.
make_connection
(
self
,
*
args
,
**
kw
)
if
timeout
is
not
None
:
# BBB: On Python < 2.7, HTTP connection is wrapped
getattr
(
connection
,
'_conn'
,
connection
).
timeout
=
timeout
connection
.
timeout
=
timeout
return
connection
self
.
make_connection
=
make_connection
...
...
@@ -49,6 +48,5 @@ class TimeoutTransport(SafeTransport):
try
:
return
SafeTransport
.
send_content
(
self
,
connection
,
request_body
)
except
socket
.
error
,
e
:
# BBB: On Python < 2.7, HTTP connection is wrapped
raise
ProtocolError
(
getattr
(
connection
,
'_conn'
,
connection
).
host
,
-
1
,
raise
ProtocolError
(
connection
.
host
,
-
1
,
"Could not connect to server"
,
None
)
This diff is collapsed.
Click to expand it.
product/ERP5Type/ERP5Type.py
View file @
7f1a4034
...
...
@@ -87,14 +87,13 @@ class LocalRoleAssignorMixIn(object):
if
owner
:
user_name
=
owner
[
1
]
else
:
for
group
,
role_list
in
(
ob
.
__ac_local_roles__
or
{}).
iteritems
():
for
user_name
,
role_list
in
(
ob
.
__ac_local_roles__
or
{}).
iteritems
():
if
'Owner'
in
role_list
:
user_name
=
group
break
else
:
user_name
=
getSecurityManager
().
getUser
().
getId
()
group_id_role_dict
=
{
user_name
:
set
((
'Owner'
,))
}
group_id_role_dict
=
{
user_name
:
{
'Owner'
}
}
local_roles_group_id_group_id
=
{}
# Merge results from applicable roles
for
role_generator
in
self
.
getFilteredRoleListFor
(
ob
):
...
...
@@ -116,18 +115,19 @@ class LocalRoleAssignorMixIn(object):
## Update role assignments to groups
# Assign new roles
ac_local_roles
=
{}
for
group
,
role_list
in
group_id_role_dict
.
iteritems
():
if
role_list
:
ac_local_roles
[
group
]
=
list
(
role_list
)
ac_local_roles
=
{
group
:
list
(
role_list
)
for
group
,
role_list
in
group_id_role_dict
.
iteritems
()
if
role_list
}
if
ac_local_roles
!=
ob
.
__ac_local_roles__
:
ob
.
__ac_local_roles__
=
ac_local_roles
if
local_roles_group_id_group_id
:
ob
.
__ac_local_roles_group_id_dict__
=
local_roles_group_id_group_id
elif
getattr
(
aq_base
(
ob
),
'__ac_local_roles_group_id_dict__'
,
None
)
is
not
None
:
delattr
(
ob
,
'__ac_local_roles_group_id_dict__'
)
else
:
try
:
del
ob
.
__ac_local_roles_group_id_dict__
except
AttributeError
:
pass
## Make sure that the object is reindexed if modified
# XXX: Document modification detection assumes local roles are always
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/__init__.py
View file @
7f1a4034
...
...
@@ -177,7 +177,6 @@ allow_module('Products.ERP5Type.JSONEncoder')
allow_module
(
'Products.ERP5Type.Log'
)
ModuleSecurityInfo
(
'Products.ERP5Type.JSON'
).
declarePublic
(
'dumps'
,
'loads'
)
ModuleSecurityInfo
(
'Products.ERP5Type.Constraint'
).
declarePublic
(
'PropertyTypeValidity'
)
ModuleSecurityInfo
(
'Products.ERP5Type.collections'
).
declarePublic
(
'OrderedDict'
)
ModuleSecurityInfo
(
'Products.ERP5Type.DiffUtils'
).
declarePublic
(
'DiffFile'
)
ModuleSecurityInfo
(
'pprint'
).
declarePublic
(
'pformat'
,
'pprint'
)
ModuleSecurityInfo
(
'Products.ERP5Type.XMLUtils'
).
declarePublic
(
'parseStream'
)
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/collections.py
deleted
100644 → 0
View file @
c70989a5
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
# XXX deprecated; use 'collections' instead, even on Python < 2.7
from
collections
import
OrderedDict
This diff is collapsed.
Click to expand it.
product/ERP5Type/patches/ExternalMethod.py
View file @
7f1a4034
...
...
@@ -112,7 +112,10 @@ if 1:
__traceback_info__
=
args
,
kw
,
self
.
_v_func_defaults
# TODO python2.7: use inspect.getcallargs instead of try..except block
# XXX: We'd like to use inspect.getcallargs instead of try..except.
# However, for the same reason as we use getargs instead of
# getargspec, we need something that works for any callable
# providing func_code & func_default (not only functions).
try
:
return
f
(
*
args
,
**
kw
)
except
TypeError
,
v
:
tb
=
sys
.
exc_info
()[
2
]
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/patches/_transaction.py
View file @
7f1a4034
...
...
@@ -11,8 +11,8 @@
#
############################################################################
# XXX: This file starts with an underscore because
by default, on Python 2.6,
#
imports are relative
.
# XXX: This file starts with an underscore because
imports are relative
#
by default
.
from
time
import
time
from
transaction
import
_manager
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/patches/python.py
View file @
7f1a4034
...
...
@@ -28,17 +28,6 @@
import
os
,
re
,
sys
if
sys
.
version_info
<
(
2
,
7
):
try
:
from
ordereddict
import
OrderedDict
except
ImportError
,
missing_ordereddict
:
def
OrderedDict
(
*
args
,
**
kw
):
raise
missing_ordereddict
import
collections
collections
.
OrderedDict
=
OrderedDict
if
1
:
# Speed up email parsing (see also http://bugs.python.org/issue1243730)
from
email
import
parser
,
feedparser
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
View file @
7f1a4034
...
...
@@ -188,7 +188,6 @@ class ERP5TypeLiveTestLoader(ERP5TypeTestLoader):
def
runLiveTest
(
test_list
,
verbosity
=
1
,
stream
=
None
,
**
kw
):
from
Products.ERP5Type.tests.runUnitTest
import
DebugTestResult
from
Products.ERP5Type.tests
import
backportUnittest
from
StringIO
import
StringIO
# Add path of the TestTemplateItem folder of the instance
path
=
kw
.
get
(
'path'
,
None
)
...
...
@@ -203,7 +202,7 @@ def runLiveTest(test_list, verbosity=1, stream=None, **kw):
sys
.
path
.
extend
(
path
for
path
in
product_test_list
if
path
not
in
current_syspath
)
TestRunner
=
backportU
nittest
.
TextTestRunner
TestRunner
=
u
nittest
.
TextTestRunner
if
ERP5TypeLiveTestCase
not
in
ERP5TypeTestCase
.
__bases__
:
ERP5TypeTestCase
.
__bases__
=
ERP5TypeLiveTestCase
,
if
kw
.
get
(
'debug'
,
False
):
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/ProcessingNodeTestCase.py
View file @
7f1a4034
...
...
@@ -8,7 +8,6 @@ from Testing import ZopeTestCase
from
ZODB.POSException
import
ConflictError
from
zLOG
import
LOG
,
ERROR
from
Products.CMFActivity.Activity.Queue
import
VALIDATION_ERROR_DELAY
from
Products.ERP5Type.tests
import
backportUnittest
from
Products.ERP5Type.tests.utils
import
addUserToDeveloperRole
from
Products.ERP5Type.tests.utils
import
createZServer
...
...
@@ -118,7 +117,7 @@ from OFS.Application import Application
Application
.
_p_resolveConflict
=
Application_resolveConflict
class
ProcessingNodeTestCase
(
backportUnittest
.
TestCase
,
ZopeTestCase
.
TestCase
):
class
ProcessingNodeTestCase
(
ZopeTestCase
.
TestCase
):
"""Minimal ERP5 TestCase class to process activities
When a processing node starts, the portal may not exist yet, or its name is
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/backportUnittest.py
View file @
7f1a4034
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/runFunctionalTest.py
View file @
7f1a4034
#!/usr/bin/env python2.
6
#!/usr/bin/env python2.
7
import
os
import
re
import
signal
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/runTestSuite.py
View file @
7f1a4034
#!/usr/bin/env python2.
6
#!/usr/bin/env python2.
7
import
argparse
,
sys
from
erp5.util
import
taskdistribution
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/runUnitTest.py
View file @
7f1a4034
#!/usr/bin/env python2.
6
#!/usr/bin/env python2.
7
import
os
import
sys
import
pdb
...
...
@@ -12,8 +12,6 @@ import errno
import
random
import
transaction
from
glob
import
glob
import
backportUnittest
try
:
from
coverage
import
coverage
except
ImportError
:
...
...
@@ -445,8 +443,7 @@ class ERP5TypeTestLoader(unittest.TestLoader):
return filtered_name_list
return name_list
# BBB: Python < 2.7
getattr(unittest, 'loader', unittest).TestLoader = ERP5TypeTestLoader
unittest.loader.TestLoader = ERP5TypeTestLoader
class DebugTestResult:
"""Wrap an unittest.TestResult, invoking pdb on errors / failures
...
...
@@ -606,7 +603,7 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
root_db_name, = cfg.dbtab.databases.keys()
DbFactory(root_db_name).addMountPoint('/')
TestRunner =
backportU
nittest.TextTestRunner
TestRunner =
u
nittest.TextTestRunner
import Lifetime
from Zope2.custom_zodb import Storage, save_mysql,
\
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/testBackportUnittest.py
deleted
100644 → 0
View file @
c70989a5
# Tester
import
unittest
# Implementation being tested
from
backportUnittest
import
TestCase
,
TextTestRunner
,
skip
,
expectedFailure
class
TestBackportUnittest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
stream
=
open
(
'/dev/null'
,
'w'
)
self
.
runner
=
TextTestRunner
(
self
.
stream
)
def
testSuccessfulTest
(
self
):
class
Success
(
TestCase
):
def
runTest
(
self
):
self
.
assert_
(
True
)
test_instance
=
Success
()
result
=
self
.
runner
.
run
(
test_instance
)
self
.
assertEqual
(
result
.
testsRun
,
1
)
self
.
assertEqual
(
len
(
result
.
errors
),
0
)
self
.
assertEqual
(
len
(
result
.
failures
),
0
)
self
.
assertEqual
(
len
(
result
.
expectedFailures
),
0
)
self
.
assertEqual
(
len
(
result
.
unexpectedSuccesses
),
0
)
self
.
assertEqual
(
len
(
result
.
skipped
),
0
)
self
.
assert_
(
result
.
wasSuccessful
())
def
testFailingTest
(
self
):
class
Failure
(
TestCase
):
def
runTest
(
self
):
self
.
assert_
(
False
)
test_instance
=
Failure
()
result
=
self
.
runner
.
run
(
test_instance
)
self
.
assertEqual
(
result
.
testsRun
,
1
)
self
.
assertEqual
(
len
(
result
.
errors
),
0
)
self
.
assertEqual
(
len
(
result
.
failures
),
1
)
self
.
assertEqual
(
len
(
result
.
expectedFailures
),
0
)
self
.
assertEqual
(
len
(
result
.
unexpectedSuccesses
),
0
)
self
.
assertEqual
(
len
(
result
.
skipped
),
0
)
self
.
assert_
(
not
result
.
wasSuccessful
())
def
testSkippingUsingMethodDecorator
(
self
):
class
Skipped
(
TestCase
):
@
skip
(
"Hey, let's skip this!"
)
def
runTest
(
self
):
self
.
assert_
(
False
)
test_instance
=
Skipped
()
result
=
self
.
runner
.
run
(
test_instance
)
self
.
assertEqual
(
result
.
testsRun
,
1
)
self
.
assertEqual
(
len
(
result
.
errors
),
0
)
self
.
assertEqual
(
len
(
result
.
failures
),
0
)
self
.
assertEqual
(
len
(
result
.
expectedFailures
),
0
)
self
.
assertEqual
(
len
(
result
.
unexpectedSuccesses
),
0
)
self
.
assertEqual
(
len
(
result
.
skipped
),
1
)
self
.
assert_
(
result
.
wasSuccessful
())
def
testSkippingUsingClassDecorator
(
self
):
class
Skipped
(
TestCase
):
def
runTest
(
self
):
self
.
assert_
(
False
)
Skipped
=
skip
(
"Class Skip?"
)(
Skipped
)
test_instance
=
Skipped
()
result
=
self
.
runner
.
run
(
test_instance
)
self
.
assertEqual
(
result
.
testsRun
,
1
)
self
.
assertEqual
(
len
(
result
.
errors
),
0
)
self
.
assertEqual
(
len
(
result
.
failures
),
0
)
self
.
assertEqual
(
len
(
result
.
expectedFailures
),
0
)
self
.
assertEqual
(
len
(
result
.
unexpectedSuccesses
),
0
)
self
.
assertEqual
(
len
(
result
.
skipped
),
1
)
self
.
assert_
(
result
.
wasSuccessful
())
def
testSkippingUsingSkipTest
(
self
):
class
Skipped
(
TestCase
):
def
runTest
(
self
):
self
.
skipTest
(
"Hey, let's skip this test!"
)
self
.
assert_
(
False
)
test_instance
=
Skipped
()
result
=
self
.
runner
.
run
(
test_instance
)
self
.
assertEqual
(
result
.
testsRun
,
1
)
self
.
assertEqual
(
len
(
result
.
errors
),
0
)
self
.
assertEqual
(
len
(
result
.
failures
),
0
)
self
.
assertEqual
(
len
(
result
.
expectedFailures
),
0
)
self
.
assertEqual
(
len
(
result
.
unexpectedSuccesses
),
0
)
self
.
assertEqual
(
len
(
result
.
skipped
),
1
)
self
.
assert_
(
result
.
wasSuccessful
())
def
testExpectedFailure
(
self
):
class
WillFail
(
TestCase
):
@
expectedFailure
def
runTest
(
self
):
self
.
assert_
(
False
)
test_instance
=
WillFail
()
result
=
self
.
runner
.
run
(
test_instance
)
self
.
assertEqual
(
result
.
testsRun
,
1
)
self
.
assertEqual
(
len
(
result
.
errors
),
0
)
self
.
assertEqual
(
len
(
result
.
failures
),
0
)
self
.
assertEqual
(
len
(
result
.
expectedFailures
),
1
)
self
.
assertEqual
(
len
(
result
.
unexpectedSuccesses
),
0
)
self
.
assertEqual
(
len
(
result
.
skipped
),
0
)
self
.
assert_
(
result
.
wasSuccessful
())
def
testUnExpectedSuccess
(
self
):
class
WillNotFail
(
TestCase
):
@
expectedFailure
def
runTest
(
self
):
self
.
assert_
(
True
)
test_instance
=
WillNotFail
()
result
=
self
.
runner
.
run
(
test_instance
)
self
.
assertEqual
(
result
.
testsRun
,
1
)
self
.
assertEqual
(
len
(
result
.
errors
),
0
)
self
.
assertEqual
(
len
(
result
.
failures
),
0
)
self
.
assertEqual
(
len
(
result
.
expectedFailures
),
0
)
self
.
assertEqual
(
len
(
result
.
unexpectedSuccesses
),
1
)
self
.
assertEqual
(
len
(
result
.
skipped
),
0
)
# Unexpected success does not FAIL the test
self
.
assert_
(
not
result
.
wasSuccessful
())
if
__name__
==
"__main__"
:
unittest
.
main
()
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
7f1a4034
...
...
@@ -33,9 +33,9 @@ import unittest
import
transaction
from
persistent
import
Persistent
from
unittest
import
expectedFailure
,
skip
from
Products.ERP5Type.dynamic.portal_type_class
import
synchronizeDynamicModules
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
,
skip
from
Products.ERP5Type.Core.PropertySheet
import
PropertySheet
as
PropertySheetDocument
from
zope.interface
import
Interface
,
implementedBy
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/testERP5Type.py
View file @
7f1a4034
...
...
@@ -32,6 +32,7 @@ import sys
import
transaction
from
random
import
randint
from
unittest
import
expectedFailure
from
Acquisition
import
aq_base
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
DummyLocalizer
...
...
@@ -47,7 +48,6 @@ from AccessControl.ZopeGuards import guarded_getattr, guarded_hasattr
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
removeZODBPythonScript
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
PropertySheetTestCase
(
ERP5TypeTestCase
):
"""Base test case class for property sheets tests.
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/testERP5TypeInterfaces.py
View file @
7f1a4034
...
...
@@ -28,7 +28,6 @@
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
zope.interface.verify
import
verifyClass
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
import
unittest
implements_tuple_list
=
[
...
...
@@ -96,7 +95,7 @@ for failing_method in [
'test_Products.ERP5Type.ConsistencyMessage_ConsistencyMessage_implements_IConsistencyMessage'
,
]:
setattr
(
TestERP5TypeInterfaces
,
failing_method
,
expectedFailure
(
getattr
(
TestERP5TypeInterfaces
,
failing_method
)))
unittest
.
expectedFailure
(
getattr
(
TestERP5TypeInterfaces
,
failing_method
)))
def
test_suite
():
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/utils.py
View file @
7f1a4034
...
...
@@ -34,6 +34,7 @@ import logging
import
random
import
socket
import
sys
import
unittest
import
ZODB
import
zLOG
from
App.config
import
getConfiguration
...
...
@@ -42,7 +43,6 @@ from Zope2.Startup.datatypes import ZopeDatabase
import
Products.ERP5Type
from
Products.MailHost.MailHost
import
MailHost
from
email
import
message_from_string
import
backportUnittest
from
Products.ERP5Type.Globals
import
PersistentMapping
from
Products.ERP5Type.Utils
import
simple_decorator
from
Products.ZSQLCatalog.SQLCatalog
import
Catalog
...
...
@@ -380,9 +380,7 @@ def reindex(func):
# The test will be skipped:
# - the fixture itself is not run
# - if a TODO test is in fact successful, no one will ever know
#
# Test cases using this decorator must extend backportUnittest.TestCase
todo_erp5
=
backportUnittest
.
skip
(
"TODO ERP5"
)
todo_erp5
=
unittest
.
skip
(
"TODO ERP5"
)
class
LogInterceptor
:
'''Replacement for Products.CMFCore.tests.base.testcase.LogInterceptor
...
...
This diff is collapsed.
Click to expand it.
product/HBTreeFolder2/tests/testHBTreeFolder2.py
View file @
7f1a4034
...
...
@@ -24,7 +24,7 @@ from OFS.Folder import Folder
from
Acquisition
import
aq_base
import
timeit
from
textwrap
import
dedent
from
Products.ERP5Type.tests.backportU
nittest
import
expectedFailure
from
u
nittest
import
expectedFailure
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.PythonScripts.PythonScript
import
PythonScript
...
...
This diff is collapsed.
Click to expand it.
product/ZSQLCatalog/tests/testSQLCatalog.py
View file @
7f1a4034
...
...
@@ -37,7 +37,6 @@ from Products.ZSQLCatalog.Query.EntireQuery import EntireQuery
from
Products.ZSQLCatalog.Query.RelatedQuery
import
RelatedQuery
from
DateTime
import
DateTime
from
Products.ZSQLCatalog.SQLExpression
import
MergeConflictError
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
class
MatchList
(
list
):
...
...
@@ -227,7 +226,7 @@ class TestSQLCatalog(ERP5TypeTestCase):
query
=
self
.
_catalog
.
buildQuery
(
kw
)
assertEqual
=
self
.
assertEqual
if
expected_failure
:
assertEqual
=
expectedFailure
(
assertEqual
)
assertEqual
=
unittest
.
expectedFailure
(
assertEqual
)
assertEqual
(
reference_tree
,
query
)
search_text
=
query
.
asSearchTextExpression
(
self
.
_catalog
)
...
...
This diff is collapsed.
Click to expand it.
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