Pruebas unitarias para el modelo de Producto
Definition at line 4 of file test_food_models.py.
◆ setUp()
test_food_models.ProductModelTests.setUp |
( |
| self | ) |
|
◆ test_actualizar_stock_producto()
test_food_models.ProductModelTests.test_actualizar_stock_producto |
( |
| self | ) |
|
Verifica que se puede actualizar el stock de un producto
Definition at line 62 of file test_food_models.py.
◆ test_categoria_str_representation()
test_food_models.ProductModelTests.test_categoria_str_representation |
( |
| self | ) |
|
Verifica que el método __str__ del modelo de categoría devuelve el nombre de la categoría
Definition at line 57 of file test_food_models.py.
◆ test_creacion_producto()
test_food_models.ProductModelTests.test_creacion_producto |
( |
| self | ) |
|
◆ test_producto_str_representation()
test_food_models.ProductModelTests.test_producto_str_representation |
( |
| self | ) |
|
Verifica que el método __str__ del modelo devuelve el nombre del producto
Definition at line 52 of file test_food_models.py.
◆ categoria1
test_food_models.ProductModelTests.categoria1 |
Initial value:= CategoriaProducto.objects.create(
nombre_categoria='Hamburguesas',
descripcion='Hamburguesas clásicas'
)
Definition at line 11 of file test_food_models.py.
◆ categoria2
test_food_models.ProductModelTests.categoria2 |
Initial value:= CategoriaProducto.objects.create(
nombre_categoria='Pizzas',
descripcion='Pizzas variadas'
)
Definition at line 16 of file test_food_models.py.
◆ producto1
test_food_models.ProductModelTests.producto1 |
Initial value:= Producto.objects.create(
nombre_producto='Hamburguesa clásica',
descripcion='Hamburguesa con queso, lechuga y tomate',
precio=500.0,
stock=10,
imageURL='hamburguesa.jpg',
id_categoria=self.categoria1
)
Definition at line 22 of file test_food_models.py.
◆ producto2
test_food_models.ProductModelTests.producto2 |
Initial value:= Producto.objects.create(
nombre_producto='Pizza Muzarella',
descripcion='Pizza con queso muzarella',
precio=800.0,
stock=5,
imageURL='pizza.jpg',
id_categoria=self.categoria2
)
Definition at line 31 of file test_food_models.py.
The documentation for this class was generated from the following file: