Commit 4fd44cf7 authored by Jérome Perrin's avatar Jérome Perrin

fix all undefined names in ERP5 unit tests, this was mostly due to the use of...

fix all undefined names in ERP5 unit tests, this was mostly due to the use of framework.py which we no longer use (runUnitTest does it for you)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16429 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b7ddea17
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
# user: user2 password: user2 # user: user2 password: user2
from threading import Thread from threading import Thread
from threading import Timer
from time import sleep from time import sleep
from urllib import urlopen
from urllib import URLopener
from urllib import addinfourl from urllib import addinfourl
from urllib import splithost
from urllib import splituser
from urllib import unquote
from urllib import splittype
import string import string
from urllib import FancyURLopener
from urllib import *
from Cookie import SimpleCookie from Cookie import SimpleCookie
def main(): def main():
......
...@@ -37,15 +37,7 @@ then erp5_content.pot and erp5_ui.pot will be made in the current directory. ...@@ -37,15 +37,7 @@ then erp5_content.pot and erp5_ui.pot will be made in the current directory.
""" """
import unittest
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
try: try:
from transaction import get as get_transaction from transaction import get as get_transaction
except ImportError: except ImportError:
...@@ -79,11 +71,8 @@ class ExtractMessageCatalog(TestXHTML): ...@@ -79,11 +71,8 @@ class ExtractMessageCatalog(TestXHTML):
for msgid in result[i].keys(): for msgid in result[i].keys():
f.write('msgid "%s"\nmsgstr ""\n\n' % msgid) f.write('msgid "%s"\nmsgstr ""\n\n' % msgid)
if __name__ == '__main__':
framework() def test_suite():
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(ExtractMessageCatalog)) suite.addTest(unittest.makeSuite(ExtractMessageCatalog))
return suite return suite
...@@ -40,13 +40,9 @@ way it is used in the invoice related simulation. ...@@ -40,13 +40,9 @@ way it is used in the invoice related simulation.
# * test removing cells for a line # * test removing cells for a line
# #
import os, sys, random import unittest
if __name__ == '__main__': import os
execfile(os.path.join(sys.path[0], 'framework.py')) import random
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
...@@ -1776,11 +1772,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase): ...@@ -1776,11 +1772,7 @@ class TestAccountingRules(TestAccountingRulesMixin, ERP5TypeTestCase):
# quantity from sum of receivable movement # quantity from sum of receivable movement
# link to sale invoice # link to sale invoice
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestAccountingRules)) suite.addTest(unittest.makeSuite(TestAccountingRules))
return suite return suite
......
...@@ -28,12 +28,7 @@ ...@@ -28,12 +28,7 @@
"""Test suite for erp5_accounting_l10n_m9 """Test suite for erp5_accounting_l10n_m9
""" """
import os, sys import unittest
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
os.environ.setdefault('EVENT_LOG_FILE', 'zLOG.log')
os.environ.setdefault('EVENT_LOG_SEVERITY', '-300')
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import reindex from Products.ERP5Type.tests.utils import reindex
...@@ -249,11 +244,7 @@ class TestAccounting_l10n_M9(ERP5TypeTestCase): ...@@ -249,11 +244,7 @@ class TestAccounting_l10n_M9(ERP5TypeTestCase):
self.assertEquals(1, len(account.checkConsistency(fixit=1))) self.assertEquals(1, len(account.checkConsistency(fixit=1)))
self.assertEquals('liability/payable', account.getAccountType()) self.assertEquals('liability/payable', account.getAccountType())
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestAccounting_l10n_M9)) suite.addTest(unittest.makeSuite(TestAccounting_l10n_M9))
return suite return suite
......
...@@ -26,33 +26,14 @@ ...@@ -26,33 +26,14 @@
# #
############################################################################## ##############################################################################
import unittest
#
# Skeleton ZopeTestCase
#
from random import randint
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, noSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from DateTime import DateTime from DateTime import DateTime
from Acquisition import aq_base, aq_inner
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.DateUtils import addToDate from Products.ERP5Type.DateUtils import addToDate
import time
import os
from Products.ERP5Type import product_path
from DateTime import DateTime
class TestAlarm(ERP5TypeTestCase): class TestAlarm(ERP5TypeTestCase):
""" """
...@@ -466,11 +447,8 @@ class TestAlarm(ERP5TypeTestCase): ...@@ -466,11 +447,8 @@ class TestAlarm(ERP5TypeTestCase):
# Chen that the second alarm execution did happen # Chen that the second alarm execution did happen
self.assertNotEquals(alarm.getLastActiveProcess(), None) self.assertNotEquals(alarm.getLastActiveProcess(), None)
if __name__ == '__main__':
framework() def test_suite():
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestAlarm)) suite.addTest(unittest.makeSuite(TestAlarm))
return suite return suite
......
...@@ -25,13 +25,9 @@ ...@@ -25,13 +25,9 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder import unittest
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log') import os
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, \ from AccessControl.SecurityManagement import newSecurityManager, \
...@@ -392,11 +388,7 @@ class TestAccountingTransactionLine(TestMovement): ...@@ -392,11 +388,7 @@ class TestAccountingTransactionLine(TestMovement):
# TODO: more asset price tests # TODO: more asset price tests
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestAmount)) suite.addTest(unittest.makeSuite(TestAmount))
suite.addTest(unittest.makeSuite(TestMovement)) suite.addTest(unittest.makeSuite(TestMovement))
......
...@@ -29,27 +29,14 @@ ...@@ -29,27 +29,14 @@
############################################################################## ##############################################################################
import os import unittest
from zLOG import LOG
from Testing import ZopeTestCase
from DateTime import DateTime from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.utils import DummyMailHost from Products.ERP5Type.tests.utils import DummyMailHost
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
class TestBug(ERP5TypeTestCase): class TestBug(ERP5TypeTestCase):
""" """
ERP5 unit tests for Bug module (part of erp5_forge business template). ERP5 unit tests for Bug module (part of erp5_forge business template).
...@@ -243,12 +230,7 @@ class TestBug(ERP5TypeTestCase): ...@@ -243,12 +230,7 @@ class TestBug(ERP5TypeTestCase):
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
def test_suite():
if __name__ == '__main__':
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestBug)) suite.addTest(unittest.makeSuite(TestBug))
return suite return suite
...@@ -26,15 +26,7 @@ ...@@ -26,15 +26,7 @@
# #
############################################################################## ##############################################################################
from random import randint import unittest
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
...@@ -4250,15 +4242,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -4250,15 +4242,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
self.assertRaises(BusinessTemplateMissingDependency, bt5.checkDependencies) self.assertRaises(BusinessTemplateMissingDependency, bt5.checkDependencies)
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestBusinessTemplate)) suite.addTest(unittest.makeSuite(TestBusinessTemplate))
return suite return suite
# vim: filetype=python syntax=python shiftwidth=2
...@@ -26,33 +26,10 @@ ...@@ -26,33 +26,10 @@
# #
############################################################################## ##############################################################################
# import unittest
# Skeleton ZopeTestCase
#
from random import randint
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, \ from Products.ERP5Type.tests.Sequence import SequenceList
noSecurityManager
from DateTime import DateTime
from Acquisition import aq_base, aq_inner
from zLOG import LOG
from Products.ERP5Type.DateUtils import addToDate
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
import time
import os
from Products.ERP5Type import product_path
from Products.CMFCore.utils import getToolByName
from testPackingList import TestPackingListMixin from testPackingList import TestPackingListMixin
class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase): class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase):
...@@ -359,11 +336,9 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase): ...@@ -359,11 +336,9 @@ class TestDivergenceTester(TestPackingListMixin, ERP5TypeTestCase):
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=self.quiet) sequence_list.play(self, quiet=self.quiet)
if __name__ == '__main__':
framework()
else: def test_suite():
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestDivergenceTester)) suite.addTest(unittest.makeSuite(TestDivergenceTester))
return suite return suite
...@@ -26,31 +26,12 @@ ...@@ -26,31 +26,12 @@
# #
############################################################################## ##############################################################################
import unittest
#
# Skeleton ZopeTestCase
#
from random import randint
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5.Document.Person import Person from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import newSecurityManager, noSecurityManager
from Products.ERP5SyncML.Conduit.ERP5Conduit import ERP5Conduit
from Products.ERP5SyncML.SyncCode import SyncCode
from zLOG import LOG from zLOG import LOG
import time
class TestDomainTool(ERP5TypeTestCase): class TestDomainTool(ERP5TypeTestCase):
...@@ -418,11 +399,7 @@ class TestDomainTool(ERP5TypeTestCase): ...@@ -418,11 +399,7 @@ class TestDomainTool(ERP5TypeTestCase):
'variation/%s/blue' % self.resource.getRelativeUrl()]), 'variation/%s/blue' % self.resource.getRelativeUrl()]),
sort_method=sort_method),45) sort_method=sort_method),45)
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestDomainTool)) suite.addTest(unittest.makeSuite(TestDomainTool))
return suite return suite
......
...@@ -25,32 +25,13 @@ ...@@ -25,32 +25,13 @@
# #
############################################################################## ##############################################################################
# import unittest
# ZopeTestCase Skeleton
#
import os
from zLOG import LOG from zLOG import LOG
from Testing import ZopeTestCase from Testing import ZopeTestCase
from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Utils import convertToUpperCase from Products.ERP5Type.Utils import convertToUpperCase
from Products.CMFCore.utils import getToolByName
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Products.ERP5.Document.Person import Person
from Products.ERP5.Document.Organisation import Organisation
...@@ -555,13 +536,7 @@ class TestBudget(ERP5TypeTestCase): ...@@ -555,13 +536,7 @@ class TestBudget(ERP5TypeTestCase):
LOG('Testing budget transaction 2... ',0,message) LOG('Testing budget transaction 2... ',0,message)
def test_suite():
if __name__ == '__main__':
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestBudget)) suite.addTest(unittest.makeSuite(TestBudget))
return suite return suite
...@@ -27,15 +27,7 @@ ...@@ -27,15 +27,7 @@
# #
############################################################################## ##############################################################################
import os import unittest
import sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from Testing import ZopeTestCase from Testing import ZopeTestCase
...@@ -250,11 +242,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -250,11 +242,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
module_portal_type, module_portal_type,
self.portal.getDefaultModule(module_portal_type).getPortalType()) self.portal.getDefaultModule(module_portal_type).getPortalType())
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Core)) suite.addTest(unittest.makeSuite(TestERP5Core))
return suite return suite
......
...@@ -25,18 +25,12 @@ ...@@ -25,18 +25,12 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder import unittest
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, \ from AccessControl.SecurityManagement import newSecurityManager
noSecurityManager from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
from Products.ERP5Type.tests.utils import createZODBPythonScript from Products.ERP5Type.tests.utils import createZODBPythonScript
class TestGeographicalAddress(ERP5TypeTestCase): class TestGeographicalAddress(ERP5TypeTestCase):
...@@ -206,11 +200,7 @@ return '%s\\n%s %s' % \\ ...@@ -206,11 +200,7 @@ return '%s\\n%s %s' % \\
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestGeographicalAddress)) suite.addTest(unittest.makeSuite(TestGeographicalAddress))
return suite return suite
...@@ -33,39 +33,16 @@ ...@@ -33,39 +33,16 @@
It will be fixed some day. It will be fixed some day.
""" """
import os, sys import unittest
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.CMFCore.utils import getToolByName
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from zLOG import LOG
from glob import glob
import time
from xml.dom.minidom import parseString
try: try:
from transaction import get as get_transaction from transaction import get as get_transaction
except ImportError: except ImportError:
pass pass
#
# Test Setting
#
INSTANCE_HOME = os.environ['INSTANCE_HOME']
bt5_path = glob(os.path.join(INSTANCE_HOME, 'bt5', '*'))[0]
# dependency order
target_business_templates = (
)
class TestICal(ERP5TypeTestCase): class TestICal(ERP5TypeTestCase):
...@@ -208,11 +185,7 @@ class TestICal(ERP5TypeTestCase): ...@@ -208,11 +185,7 @@ class TestICal(ERP5TypeTestCase):
self.assertEquals(feed_dict['PERCENT-COMPLETE'], '100') self.assertEquals(feed_dict['PERCENT-COMPLETE'], '100')
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestICal)) suite.addTest(unittest.makeSuite(TestICal))
return suite return suite
...@@ -27,31 +27,13 @@ ...@@ -27,31 +27,13 @@
############################################################################## ##############################################################################
import unittest
#
# Skeleton ZopeTestCase
#
from random import randint
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from AccessControl.SecurityManagement import newSecurityManager, noSecurityManager
from Products.DCWorkflow.DCWorkflow import Unauthorized, ValidationFailed
from DateTime import DateTime from DateTime import DateTime
from Acquisition import aq_base, aq_inner
from zLOG import LOG from zLOG import LOG
from testOrder import TestOrderMixin from testOrder import TestOrderMixin
import time
from Products.ERP5.Document.ImmobilisationMovement import UNIMMOBILISING_METHOD, NO_CHANGE_METHOD from Products.ERP5.Document.ImmobilisationMovement import UNIMMOBILISING_METHOD, NO_CHANGE_METHOD
try: try:
...@@ -3863,13 +3845,7 @@ class TestImmobilisation(TestImmobilisationMixin): ...@@ -3863,13 +3845,7 @@ class TestImmobilisation(TestImmobilisationMixin):
sequence_list.play(self) sequence_list.play(self)
def test_suite():
if __name__ == '__main__':
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestImmobilisation)) suite.addTest(unittest.makeSuite(TestImmobilisation))
return suite return suite
......
...@@ -26,29 +26,12 @@ ...@@ -26,29 +26,12 @@
# #
############################################################################## ##############################################################################
import unittest
#
# Skeleton ZopeTestCase
#
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.Base import _aq_reset from Products.ERP5Type.Base import _aq_reset
from Products.ERP5.Document.Organisation import Organisation from Products.ERP5.Document.Organisation import Organisation
from DateTime import DateTime from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5.Document.Person import Person
from AccessControl.SecurityManagement import newSecurityManager, noSecurityManager
from zLOG import LOG
import time
class TestInteractionWorkflow(ERP5TypeTestCase): class TestInteractionWorkflow(ERP5TypeTestCase):
...@@ -442,11 +425,8 @@ class TestInteractionWorkflow(ERP5TypeTestCase): ...@@ -442,11 +425,8 @@ class TestInteractionWorkflow(ERP5TypeTestCase):
# - interaction:setVatCode(bara) # - interaction:setVatCode(bara)
self.assertEquals(organisation.getVatCode(),'bara') self.assertEquals(organisation.getVatCode(),'bara')
if __name__ == '__main__':
framework() def test_suite():
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestInteractionWorkflow)) suite.addTest(unittest.makeSuite(TestInteractionWorkflow))
return suite return suite
......
...@@ -39,31 +39,16 @@ ...@@ -39,31 +39,16 @@
# aggregated item ? # aggregated item ?
from random import randint import unittest
from Products.ERP5Type.Utils import cartesianProduct from Products.ERP5Type.Utils import cartesianProduct
from copy import copy from copy import copy
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, \
noSecurityManager
from DateTime import DateTime from DateTime import DateTime
from Acquisition import aq_base, aq_inner
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.DateUtils import addToDate from Products.ERP5Type.DateUtils import addToDate
import time
import os
from Products.ERP5Type import product_path
from Products.CMFCore.utils import getToolByName
from testOrder import TestOrderMixin from testOrder import TestOrderMixin
from Products.ERP5Form.Selection import DomainSelection from Products.ERP5Form.Selection import DomainSelection
...@@ -1909,11 +1894,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -1909,11 +1894,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
sequence_list.play(self) sequence_list.play(self)
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestInventory)) suite.addTest(unittest.makeSuite(TestInventory))
return suite return suite
......
...@@ -32,12 +32,9 @@ TODO: test variation ...@@ -32,12 +32,9 @@ TODO: test variation
""" """
import sys
import random
import os import os
import random
if __name__ == '__main__': import unittest
execfile(os.path.join(sys.path[0], 'framework.py'))
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from DateTime import DateTime from DateTime import DateTime
...@@ -47,10 +44,6 @@ from Products.ERP5.Document.OrderRule import OrderRule ...@@ -47,10 +44,6 @@ from Products.ERP5.Document.OrderRule import OrderRule
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import reindex from Products.ERP5Type.tests.utils import reindex
# Needed in order to have a log file inside the current folder
os.environ.setdefault('EVENT_LOG_FILE', 'zLOG.log')
os.environ.setdefault('EVENT_LOG_SEVERITY', '-300')
class InventoryAPITestCase(ERP5TypeTestCase): class InventoryAPITestCase(ERP5TypeTestCase):
"""Base class for Inventory API Tests {{{ """Base class for Inventory API Tests {{{
""" """
...@@ -1829,11 +1822,7 @@ class TestInventoryDocument(InventoryAPITestCase): ...@@ -1829,11 +1822,7 @@ class TestInventoryDocument(InventoryAPITestCase):
self._checkInventoryList(inventory, reference_inventory, self._checkInventoryList(inventory, reference_inventory,
ordered_check=True) ordered_check=True)
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestInventory)) suite.addTest(unittest.makeSuite(TestInventory))
suite.addTest(unittest.makeSuite(TestInventoryList)) suite.addTest(unittest.makeSuite(TestInventoryList))
......
...@@ -29,13 +29,7 @@ ...@@ -29,13 +29,7 @@
Tests VAT for invoices. Tests VAT for invoices.
""" """
import os, sys import unittest
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ.setdefault('EVENT_LOG_FILE', 'zLOG.log')
os.environ.setdefault('EVENT_LOG_SEVERITY', '-300')
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
...@@ -509,11 +503,7 @@ class TestInvoiceVAT(ERP5TypeTestCase): ...@@ -509,11 +503,7 @@ class TestInvoiceVAT(ERP5TypeTestCase):
self._checkInvoiceVAT(invoice, total_price, vat_ratio, self._checkInvoiceVAT(invoice, total_price, vat_ratio,
total_vat_amount) total_vat_amount)
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestInvoiceVAT)) suite.addTest(unittest.makeSuite(TestInvoiceVAT))
return suite return suite
......
...@@ -27,32 +27,13 @@ ...@@ -27,32 +27,13 @@
# #
############################################################################## ##############################################################################
# import unittest
# Skeleton ZopeTestCase
#
from random import randint
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, \ from AccessControl.SecurityManagement import newSecurityManager
noSecurityManager
from DateTime import DateTime from DateTime import DateTime
from Acquisition import aq_base, aq_inner
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.DateUtils import addToDate from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
import time
import os
from Products.ERP5Type import product_path
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
class TestOrderMixin: class TestOrderMixin:
...@@ -1812,11 +1793,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase): ...@@ -1812,11 +1793,7 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
# if not run: return # if not run: return
# self.failUnless(1==2) # self.failUnless(1==2)
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestOrder)) suite.addTest(unittest.makeSuite(TestOrder))
return suite return suite
...@@ -26,33 +26,11 @@ ...@@ -26,33 +26,11 @@
# #
############################################################################## ##############################################################################
# import unittest
# Skeleton ZopeTestCase
#
from random import randint
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, \
noSecurityManager
from DateTime import DateTime
from Acquisition import aq_base, aq_inner
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.DateUtils import addToDate from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
import time
import os
from Products.ERP5Type import product_path
from Products.CMFCore.utils import getToolByName
from testOrder import TestOrderMixin from testOrder import TestOrderMixin
class TestPackingListMixin(TestOrderMixin): class TestPackingListMixin(TestOrderMixin):
...@@ -916,11 +894,7 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) : ...@@ -916,11 +894,7 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
).newContent(portal_type=self.packing_list_portal_type) ).newContent(portal_type=self.packing_list_portal_type)
self.failUnless(hasattr(pl, 'getPriceCurrency')) self.failUnless(hasattr(pl, 'getPriceCurrency'))
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestPackingList)) suite.addTest(unittest.makeSuite(TestPackingList))
return suite return suite
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
# #
############################################################################## ##############################################################################
import unittest
from testPackingList import TestPackingList from testPackingList import TestPackingList
class TestPackingListRoundingPrecision(TestPackingList): class TestPackingListRoundingPrecision(TestPackingList):
...@@ -38,11 +39,7 @@ class TestPackingListRoundingPrecision(TestPackingList): ...@@ -38,11 +39,7 @@ class TestPackingListRoundingPrecision(TestPackingList):
def getTitle(self): def getTitle(self):
return "Packing List Rounding Precision" return "Packing List Rounding Precision"
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestPackingListRoundingPrecision)) suite.addTest(unittest.makeSuite(TestPackingListRoundingPrecision))
return suite return suite
...@@ -26,24 +26,10 @@ ...@@ -26,24 +26,10 @@
# #
############################################################################## ##############################################################################
import os, sys import unittest
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from zLOG import LOG
import time
try:
from transaction import get as get_transaction
except ImportError:
pass
class TestPerson(ERP5TypeTestCase): class TestPerson(ERP5TypeTestCase):
...@@ -134,11 +120,7 @@ class TestPerson(ERP5TypeTestCase): ...@@ -134,11 +120,7 @@ class TestPerson(ERP5TypeTestCase):
title='title' ) title='title' )
# no infinite loop :) but there's no guarantee on the behaviour # no infinite loop :) but there's no guarantee on the behaviour
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestPerson)) suite.addTest(unittest.makeSuite(TestPerson))
return suite return suite
...@@ -27,32 +27,11 @@ ...@@ -27,32 +27,11 @@
# #
############################################################################## ##############################################################################
# import unittest
# Skeleton ZopeTestCase
#
from random import randint
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, \
noSecurityManager
from DateTime import DateTime
from Acquisition import aq_base, aq_inner
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.DateUtils import addToDate from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
import time
import os
from Products.ERP5Type import product_path
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from testOrder import TestOrderMixin from testOrder import TestOrderMixin
...@@ -1152,11 +1131,7 @@ class TestProductionOrder(TestProductionOrderMixin, ERP5TypeTestCase): ...@@ -1152,11 +1131,7 @@ class TestProductionOrder(TestProductionOrderMixin, ERP5TypeTestCase):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestProductionOrder)) suite.addTest(unittest.makeSuite(TestProductionOrder))
return suite return suite
...@@ -26,21 +26,7 @@ ...@@ -26,21 +26,7 @@
# #
############################################################################## ##############################################################################
# import unittest
# Skeleton ZopeTestCase
#
from random import randint
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from zLOG import LOG
from testOrder import TestOrder from testOrder import TestOrder
...@@ -61,11 +47,7 @@ class TestPurchaseOrder(TestOrder): ...@@ -61,11 +47,7 @@ class TestPurchaseOrder(TestOrder):
def getTitle(self): def getTitle(self):
return "Purchase Order" return "Purchase Order"
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestPurchaseOrder)) suite.addTest(unittest.makeSuite(TestPurchaseOrder))
return suite return suite
......
...@@ -25,21 +25,10 @@ ...@@ -25,21 +25,10 @@
# #
############################################################################## ##############################################################################
import os, sys import unittest
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.CMFCore.utils import getToolByName
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from zLOG import LOG
from glob import glob
import time
from xml.dom.minidom import parseString from xml.dom.minidom import parseString
...@@ -48,14 +37,6 @@ try: ...@@ -48,14 +37,6 @@ try:
except ImportError: except ImportError:
pass pass
#
# Test Setting
#
INSTANCE_HOME = os.environ['INSTANCE_HOME']
bt5_path = glob(os.path.join(INSTANCE_HOME, 'bt5', '*'))[0]
# dependency order
target_business_templates = (
)
def getNodeContent(node): def getNodeContent(node):
return node.childNodes[0].nodeValue return node.childNodes[0].nodeValue
...@@ -133,11 +114,7 @@ class TestRSS(ERP5TypeTestCase): ...@@ -133,11 +114,7 @@ class TestRSS(ERP5TypeTestCase):
self.assertEquals(one.getCreationDate().rfc822(), getSubnodeContent(item, 'pubDate')) self.assertEquals(one.getCreationDate().rfc822(), getSubnodeContent(item, 'pubDate'))
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestRSS)) suite.addTest(unittest.makeSuite(TestRSS))
return suite return suite
...@@ -26,29 +26,14 @@ ...@@ -26,29 +26,14 @@
# #
############################################################################## ##############################################################################
from random import randint import unittest
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, \ from AccessControl.SecurityManagement import newSecurityManager
noSecurityManager
from DateTime import DateTime
from Acquisition import aq_base, aq_inner
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.DateUtils import addToDate from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
import time
import os
from Products.ERP5Type import product_path
from Products.CMFCore.utils import getToolByName
class TestResource(ERP5TypeTestCase): class TestResource(ERP5TypeTestCase):
""" """
...@@ -760,11 +745,8 @@ class TestResource(ERP5TypeTestCase): ...@@ -760,11 +745,8 @@ class TestResource(ERP5TypeTestCase):
resource.setBaseUnitQuantity(0.001) resource.setBaseUnitQuantity(0.001)
self.assertEquals(3, resource.getQuantityPrecision()) self.assertEquals(3, resource.getQuantityPrecision())
if __name__ == '__main__':
framework() def test_suite():
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestResource)) suite.addTest(unittest.makeSuite(TestResource))
return suite return suite
...@@ -26,26 +26,14 @@ ...@@ -26,26 +26,14 @@
# #
############################################################################## ##############################################################################
# import unittest
# Skeleton ZopeTestCase
#
from random import randint
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, noSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from zLOG import LOG from zLOG import LOG
from App.config import getConfiguration from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
class TestTrashTool(ERP5TypeTestCase): class TestTrashTool(ERP5TypeTestCase):
""" """
...@@ -400,11 +388,7 @@ class TestTrashTool(ERP5TypeTestCase): ...@@ -400,11 +388,7 @@ class TestTrashTool(ERP5TypeTestCase):
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestTrashTool)) suite.addTest(unittest.makeSuite(TestTrashTool))
return suite return suite
...@@ -25,21 +25,13 @@ ...@@ -25,21 +25,13 @@
# #
############################################################################## ##############################################################################
import os, sys import unittest
if __name__ == '__main__': import os
execfile(os.path.join(sys.path[0], 'framework.py'))
# Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from zLOG import LOG
from glob import glob from glob import glob
import time
try: try:
from transaction import get as get_transaction from transaction import get as get_transaction
...@@ -198,11 +190,7 @@ def addTestMethodDynamically(): ...@@ -198,11 +190,7 @@ def addTestMethodDynamically():
addTestMethodDynamically() addTestMethodDynamically()
if __name__ == '__main__': def test_suite():
framework()
else:
import unittest
def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestXHTML)) suite.addTest(unittest.makeSuite(TestXHTML))
return suite return suite
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