Beispiel #1
0
 def setUpClass(cls):
     dbapi = make_test_dbapi()
     fileservice = FileService('/tmp')
     inventoryapi = InventoryApi('/tmp')
     auth_decorator = lambda x: x
     invmomanager = InvMovementManager(dbapi, fileservice, inventoryapi)
     wsgi = make_import_apis('/import', auth_decorator, dbapi, invmomanager)
     cls.test_app = TestApp(wsgi)
     cls.dbapi = dbapi
    def setUpClass(cls):
        dbapi = make_test_dbapi()
        filemanager = FileService('/tmp')
        transaction = FakeTransaction()
        invapi = DocumentApi(dbapi.session, filemanager, transaction, Invoice)
        pedidoapi = PedidoApi(sessionmanager=dbapi.session, filemanager=filemanager)
        identity = lambda x: x
        wsgi = make_nota_api(
            '/api',
            dbapi,
            actionlogged=identity,
            invapi=invapi,
            auth_decorator=identity,
            pedidoapi=pedidoapi,
            workerqueue=None)
        cls.test_app = TestApp(wsgi)
        cls.dbapi = dbapi
        #insert some pricelist items

        with dbapi.session:
#            p1 = PriceList()
#            p1.precio1 = 150
#            p1.nombre = 'HILO ALGODON FINO'
#            p1.prod_id = 'HALGF'
#            p1.precio2 = 125
#            p1.threshold = 6000
#            p1.almacen_id = 1
#            dbapi.create(p1)
#            p2 = PriceList()
#            p2.almacen_id = 1
#            p2.precio1 = 50
#            p2.nombre = 'TERMINAL DE PULSERA MD.'
#            p2.prod_id = 'TPM'
#            p2.precio2 = 40
#            p2.threshold = 6000
#            dbapi.create(p2)
            alm = Store()
            alm.almacen_id = 3
            dbapi.create(alm)
            dbapi.db_session.commit()
Beispiel #3
0
    def setUpClass(cls):
        dbapi = make_test_dbapi()
        filemanager = FileService('/tmp')
        transaction = FakeTransaction()
        invapi = DocumentApi(dbapi.session, filemanager, transaction, Invoice)
        pedidoapi = PedidoApi(sessionmanager=dbapi.session, filemanager=filemanager)
        identity = lambda x: x
        wsgi = make_nota_api(
            '/api',
            dbapi,
            actionlogged=identity,
            invapi=invapi,
            auth_decorator=identity,
            pedidoapi=pedidoapi)
        cls.test_app = TestApp(wsgi)
        cls.dbapi = dbapi
        #insert some pricelist items

        with dbapi.session:
#            p1 = PriceList()
#            p1.precio1 = 150
#            p1.nombre = 'HILO ALGODON FINO'
#            p1.prod_id = 'HALGF'
#            p1.precio2 = 125
#            p1.threshold = 6000
#            p1.almacen_id = 1
#            dbapi.create(p1)
#            p2 = PriceList()
#            p2.almacen_id = 1
#            p2.precio1 = 50
#            p2.nombre = 'TERMINAL DE PULSERA MD.'
#            p2.prod_id = 'TPM'
#            p2.precio2 = 40
#            p2.threshold = 6000
#            dbapi.create(p2)
            alm = Store()
            alm.almacen_id = 3
            dbapi.create(alm)
            dbapi.db_session.commit()