Example #1
0
 def setUp(self):
     drop_database()
     create_database()
     User('Daniel Machado Castillo', '*****@*****.**',
          '+573138966044', 'Freqm0d+', 1).add_item()
     User('Yoshi Restall', '*****@*****.**', '926-587-9732', 'Freqm0d+',
          1).add_item()
Example #2
0
 def setUp(self):
     drop_database()
     create_database()
     save_test_data('usuarios.csv', User)
     save_test_data('almacen.csv', Store)
     save_test_data('categoria_producto.csv', ProductCategory)
     save_test_data('fabricante.csv', Brand)
     save_test_data('productos.csv', Product)
     pass
Example #3
0
    def setUp(self):
        drop_database()
        create_database()
        Brand('Aldy', '').add_manufacturer()
        categories = [
            'Mercado', 'Alimentos', 'Despensa', 'AzĂșcar, panela y endulzante',
            'Endulzantes'
        ]
        for category in categories:
            parent_index = categories.index(category) - 1
            if parent_index < 0:
                parent = None
            else:
                parent_name = categories[parent_index]
                parent = get_product_category_id(parent_name)
            ProductCategory(parent, category).add_product_category()

        Product(
            5,
            1,
            'Endulzante Aldy X 200 Gramos',
            '258974',
            1,
        ).add_product()
        Product(
            5,
            1,
            'Endulzante Aldy X 201 Gramos',
            '258975',
            1,
        ).add_product()
        Product(
            5,
            1,
            'Endulzante Aldy X 202 Gramos',
            '258976',
            1,
        ).add_product()
        Product(
            5,
            1,
            'Endulzante Aldy X 203 Gramos',
            '258977',
            1,
        ).add_product()
        Product(
            5,
            1,
            'Endulzante Aldy X 205 Gramos',
            '258978',
            1,
        ).add_product()
Example #4
0
 def setUp(self):
     create_database()
Example #5
0
 def setUp(self):
     drop_database()
     create_database()
    def setUp(self):
        pass
        drop_database()
        create_database()

        save_test_data('usuarios.csv', User)
        save_test_data('almacen.csv', Store)
        save_test_data('categoria_producto.csv', ProductCategory)
        save_test_data('fabricante.csv', Brand)
        save_test_data('productos.csv', Product)

        test_user_1 = get_user_by_mail('*****@*****.**')
        test_warehouse_1 = get_warehouse_by_name('Snaptags')
        test_warehouse_member_1 = StoreEmployee(test_user_1.id_usuario,
                                                test_warehouse_1.id_almacen)
        test_user_2 = get_user_by_mail('*****@*****.**')
        test_warehouse_2 = get_warehouse_by_name('Latz')
        test_warehouse_member_2 = StoreEmployee(test_user_2.id_usuario,
                                                test_warehouse_2.id_almacen)
        test_user_3 = get_user_by_mail('*****@*****.**')
        test_warehouse_3 = get_warehouse_by_name('Twinte')
        test_warehouse_member_3 = StoreEmployee(test_user_3.id_usuario,
                                                test_warehouse_3.id_almacen)
        test_warehouse_member_1.add_warehouse_member(test_user_1.id_usuario)
        test_warehouse_member_2.add_warehouse_member(test_user_2.id_usuario)
        test_warehouse_member_3.add_warehouse_member(test_user_3.id_usuario)

        inventory_test_1 = Stock(1, test_warehouse_1.id_almacen, 1100)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_1.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(2, test_warehouse_1.id_almacen, 2100)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_1.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(3, test_warehouse_1.id_almacen, 3100)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_1.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(4, test_warehouse_1.id_almacen, 4100)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_1.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(5, test_warehouse_1.id_almacen, 5100)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_1.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(6, test_warehouse_1.id_almacen, 6100)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_1.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(7, test_warehouse_1.id_almacen, 7100)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_1.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(8, test_warehouse_1.id_almacen, 8100)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_1.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(9, test_warehouse_1.id_almacen, 9100)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_1.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(10, test_warehouse_1.id_almacen, 10100)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_1.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()

        inventory_test_1 = Stock(1, test_warehouse_2.id_almacen, 1200)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_2.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(2, test_warehouse_2.id_almacen, 2200)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_2.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(3, test_warehouse_2.id_almacen, 3200)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_2.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(4, test_warehouse_2.id_almacen, 4200)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_2.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(5, test_warehouse_2.id_almacen, 5200)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_2.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(6, test_warehouse_2.id_almacen, 6200)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_2.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(7, test_warehouse_2.id_almacen, 7200)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_2.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(8, test_warehouse_2.id_almacen, 8200)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_2.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(9, test_warehouse_2.id_almacen, 9200)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_2.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(10, test_warehouse_2.id_almacen, 10200)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_2.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()

        inventory_test_1 = Stock(1, test_warehouse_3.id_almacen, 1300)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_3.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(2, test_warehouse_3.id_almacen, 2300)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_3.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(3, test_warehouse_3.id_almacen, 3300)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_3.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(4, test_warehouse_3.id_almacen, 4300)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_3.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(5, test_warehouse_3.id_almacen, 5300)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_3.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(6, test_warehouse_3.id_almacen, 6300)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_3.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(7, test_warehouse_3.id_almacen, 7300)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_3.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(8, test_warehouse_3.id_almacen, 8300)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_3.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(9, test_warehouse_3.id_almacen, 9300)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_3.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()
        inventory_test_1 = Stock(10, test_warehouse_3.id_almacen, 10300)
        inventory_test_1.add_item()
        StockInput(inventory_test_1.stock_item_id,
                   test_warehouse_member_3.store_employee_id, 10,
                   datetime.datetime.now()).add_inventory_input()

        DynamicBasket(test_user_1.id_usuario, 1, 5).add_item()
        DynamicBasket(test_user_1.id_usuario, 2, 5).add_item()
        DynamicBasket(test_user_1.id_usuario, 3, 5).add_item()
        DynamicBasket(test_user_1.id_usuario, 4, 5).add_item()
        DynamicBasket(test_user_1.id_usuario, 5, 5).add_item()
        DynamicBasket(test_user_1.id_usuario, 6, 5).add_item()
        DynamicBasket(test_user_1.id_usuario, 7, 5).add_item()
        DynamicBasket(test_user_1.id_usuario, 8, 5).add_item()
        DynamicBasket(test_user_1.id_usuario, 9, 5).add_item()
        DynamicBasket(test_user_1.id_usuario, 10, 5).add_item()

        StandardBasket(test_user_1.id_usuario, 1, 5).add_item()
        StandardBasket(test_user_1.id_usuario, 2, 5).add_item()
        StandardBasket(test_user_1.id_usuario, 3, 5).add_item()
        StandardBasket(test_user_1.id_usuario, 4, 5).add_item()
        StandardBasket(test_user_1.id_usuario, 5, 5).add_item()
        StandardBasket(test_user_1.id_usuario, 6, 5).add_item()
        StandardBasket(test_user_1.id_usuario, 7, 5).add_item()
        StandardBasket(test_user_1.id_usuario, 8, 5).add_item()
        StandardBasket(test_user_1.id_usuario, 9, 5).add_item()
        StandardBasket(test_user_1.id_usuario, 10, 5).add_item()