You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def test_order_product_DELETE(self):
#Creo un producto
producto = {
'id':1,
'name': 'Tenedor',
'price': 50
}
self.client.post('/product', data=json.dumps(producto), content_type='application/json')
#Creo una orden
order = {
"id": 1
}
order = Order()
#Guardo la orden en la db directo ya que no está en endpoint en la api
db.session.add(order)
db.session.commit()
orderProduct = {"quantity":1,"product":{"id":1}}
#Creo el OrderProduct
self.client.post('/order/1/product', data=json.dumps(orderProduct), content_type='application/json')
#Lo elimino
self.client.delete('/order/1/product/1', data=json.dumps(orderProduct), content_type='application/json')
p = Product.query.all()
self.assertEqual(len(p), 0, "Hay productos, fallo el test")
Me tira que hay un producto:
E AssertionError: 1 != 0 : Hay productos, fallo el test
The text was updated successfully, but these errors were encountered:
Me tira que hay un producto:
E AssertionError: 1 != 0 : Hay productos, fallo el test
The text was updated successfully, but these errors were encountered: