Pruebas unitarias para las vistas de carrito
Definition at line 11 of file test_cart_views.py.
◆ setUp()
test_cart_views.CartViewTests.setUp |
( |
| self | ) |
|
◆ test_agregar_producto_al_carrito()
test_cart_views.CartViewTests.test_agregar_producto_al_carrito |
( |
| self | ) |
|
Prueba que se puede agregar un producto al carrito
Definition at line 62 of file test_cart_views.py.
◆ test_confirmar_pedido_vacio()
test_cart_views.CartViewTests.test_confirmar_pedido_vacio |
( |
| self | ) |
|
◆ test_ver_carrito()
test_cart_views.CartViewTests.test_ver_carrito |
( |
| self | ) |
|
◆ add_to_cart_url
test_cart_views.CartViewTests.add_to_cart_url = reverse('appCART:agregar-producto', args=[self.producto.id_producto]) |
◆ categoria
test_cart_views.CartViewTests.categoria |
Initial value:= CategoriaProducto.objects.create(
nombre_categoria='Hamburguesas',
descripcion='Hamburguesas clásicas'
)
Definition at line 34 of file test_cart_views.py.
◆ client
test_cart_views.CartViewTests.client = APIClient() |
◆ confirm_order_url
test_cart_views.CartViewTests.confirm_order_url = reverse('appCART:confirmar-pedido') |
◆ pedido
test_cart_views.CartViewTests.pedido |
Initial value:= Pedido.objects.create(
id_usuario=self.usuario,
fecha_pedido=date.today(),
direccion_entrega=self.usuario.direccion,
estado='Pendiente'
)
Definition at line 50 of file test_cart_views.py.
◆ producto
test_cart_views.CartViewTests.producto |
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.categoria
)
Definition at line 40 of file test_cart_views.py.
◆ usuario
test_cart_views.CartViewTests.usuario |
Initial value:= Usuario.objects.create_user(
email='cliente@example.com',
password='password123',
nombre='Cliente',
apellido='Test',
telefono='1234567890',
direccion='Calle Falsa 123'
)
Definition at line 21 of file test_cart_views.py.
◆ view_cart_url
test_cart_views.CartViewTests.view_cart_url = reverse('appCART:ver-carrito') |
The documentation for this class was generated from the following file: