81
83
assert coordo_count > 0 if project_count > 0 else coordo_count >= 0, \
82
84
"Wrong number of Coordinations and Projects!"
84
#Load OpenERP Client Library
88
86
#from tests import *
89
87
from tests.openerplib import db
91
89
from scripts.common import *
93
91
#Load tests procedures
92
#TODO: use unittest2 instead of unittest to make the command-line arguments
93
# work with python < 2.7
94
94
if sys.version_info >= (2, 7):
97
97
# Needed for setUpClass and skipIf methods
98
98
import unittest27 as unittest
105
100
skipCreation = False
106
101
skipModules = False
107
102
skipModuleUpdate = False
259
255
answer = getattr(self.db.wizard(model, data), button)()
260
256
model = answer.get('res_model', None)
262
_logger.info( "DEBUG: db=%s, model=%s" % (self.db.name, model))
258
warn("DEBUG: db=%s, model=%s" % (self.db.name, model))
480
476
'property_account_receivable' : account.search([('code','=','1205')])[0],
484
479
@unittest.skipIf(skipOpenPeriod, "Open Period desactivated")
485
480
def test_92_open_period(self):
486
481
self.db.connect('admin')
488
482
today = time.strftime('%Y-%m-%d')
489
483
month = time.strftime('%m')
490
484
# search current fiscalyear
611
605
class verbose(unittest.TestCase):
612
606
def test_10_show_hqs(self):
613
_logger.info("---------------------")
614
608
for tc_hq in filter(lambda tc:issubclass(tc, hqn_creation), test_cases):
615
_logger.info( " * %s" % hqn_creation.name_format % (config.prefix, tc_hq.index))
609
warn( " * %s" % hqn_creation.name_format % (config.prefix, tc_hq.index))
616
610
for tc in filter(lambda tc:issubclass(tc, coordon_creation) \
617
611
and tc.parent is tc_hq, test_cases):
618
_logger.info( " - %s" % coordon_creation.name_format % (config.prefix, tc.index))
619
_logger.info("---------------------")
612
warn( " - %s" % coordon_creation.name_format % (config.prefix, tc.index))
621
615
def test_20_show_coordos(self):
623
617
for tc_coordo in filter(lambda tc:issubclass(tc, coordon_creation), test_cases):
624
_logger.info( " * %s" % coordon_creation.name_format % (config.prefix, tc_coordo.index))
618
warn( " * %s" % coordon_creation.name_format % (config.prefix, tc_coordo.index))
625
619
for tc in filter(lambda tc:issubclass(tc, projectn_creation) \
626
620
and tc.parent is tc_coordo, test_cases):
627
_logger.debug( " - %s" % projectn_creation.name_format % (config.prefix, tc.index))
628
_logger.info("---------------------")
621
warn( " - %s" % projectn_creation.name_format % (config.prefix, tc.index))