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