Exemplo n.º 1
0
 def test_arg_format(self):
     a = ([],)
     with pytest.raises(MapistarProgrammingError) as exc:
         import_models(a)
     assert (
         str(exc.value)
         == "Déclaration de module sous la forme str ou tuple('base', ('module1','modele2'))"
     )
Exemplo n.º 2
0
 def test_insinstance_tuple(self, mocker):
     call = mocker.call
     models = [("actes", ("observations", "ordonnances", "ordo_items"))]
     r = mocker.patch("importlib.import_module")
     import_models(models)
     calls = [
         call("mapistar.actes.observations"),
         call("mapistar.actes.ordonnances"),
         call("mapistar.actes.ordo_items"),
     ]
     r.assert_has_calls(calls)
Exemplo n.º 3
0
# Third Party Libraries
from simple_settings import settings

# mapistar
from mapistar.base_db import db
from mapistar.utils import import_models

import_models(settings.MODELS)


# db.connect(**settings.DATABASE)

settings.DATABASE.pop("create_tables")


db.bind(**settings.DATABASE)

db.generate_mapping(create_tables=True)