Beispiel #1
0
import logging
import weakref

from Modeling import ModelSet, Model, dynamic
from Modeling.utils import capitalizeFirstLetter

from fvl.cimarron.model import Model as CimarronModel

logger = logging.getLogger('fvl.luca.model.base')
# logger.setLevel(logging.DEBUG)

model_name = os.getenv('LUCA_PYMODEL',
                       os.path.join(os.path.dirname(__file__),
                                    'pymodel_luca.py' ))
try:
    model = Model.loadModel(model_name)
except ImportError:
    logger.critical("I couldn't load the pymodel from file %r."
                    " Please read INSTALL.txt" % model_name)
    raise
del model_name
ModelSet.defaultModelSet().addModel(model)


class ModelingList(object):
    def __init__(self, value=None, relatesTo=None,
                 append=None, remove=None, inverse=None):
        self.value = value
        self.appendMethod = append
        self.removeMethod = remove
        self.relatesTo = relatesTo
__revision__ = int('$Rev$'[5:-1])

import unittest
import os

from fvl.luca.transaction import Transaction
from Modeling import Model, ModelSet, dynamic
from Modeling.EditingContext import EditingContext

from testWithDatabase import testWithDatabase

dn = os.path.dirname(__file__)
model_file = 'test/tr_pymodel_test.py'

model=Model.loadModel(model_file)
ModelSet.defaultModelSet().addModel(model)
dynamic.build_with_metaclass(model, define_properties=1)

database_file = model._connectionDictionary['database']

from Tester.aProduct import aProduct

# hack up the class to work
aProduct.transaction = lambda *a: None

class TestTransaction(unittest.TestCase):
    def setUp(self):
        self.tr = Transaction()
        self.other_tr = Transaction()
Beispiel #3
0
import os
import logging
import weakref

from Modeling import ModelSet, Model, dynamic
from Modeling.utils import capitalizeFirstLetter

from fvl.cimarron.model import Model as CimarronModel

logger = logging.getLogger('fvl.luca.model.base')
# logger.setLevel(logging.DEBUG)

model_name = os.getenv(
    'LUCA_PYMODEL', os.path.join(os.path.dirname(__file__), 'pymodel_luca.py'))
try:
    model = Model.loadModel(model_name)
except ImportError:
    logger.critical("I couldn't load the pymodel from file %r."
                    " Please read INSTALL.txt" % model_name)
    raise
del model_name
ModelSet.defaultModelSet().addModel(model)


class ModelingList(object):
    def __init__(self,
                 value=None,
                 relatesTo=None,
                 append=None,
                 remove=None,
                 inverse=None):
__revision__ = int('$Rev$'[5:-1])

import unittest
import os

from fvl.luca.transaction import Transaction
from Modeling import Model, ModelSet, dynamic
from Modeling.EditingContext import EditingContext

from testWithDatabase import testWithDatabase

dn = os.path.dirname(__file__)
model_file = 'test/tr_pymodel_test.py'

model = Model.loadModel(model_file)
ModelSet.defaultModelSet().addModel(model)
dynamic.build_with_metaclass(model, define_properties=1)

database_file = model._connectionDictionary['database']

from Tester.aProduct import aProduct

# hack up the class to work
aProduct.transaction = lambda *a: None


class TestTransaction(unittest.TestCase):
    def setUp(self):
        self.tr = Transaction()
        self.other_tr = Transaction()