def test_not_shipping_orders_that_should_not_be_shipped( order, ship, change_order): change_order(order) tasks.ship_unshipped_orders() ship.assert_not_called()
def test_order_is_marked_as_shipped(order): assert order.shipped is None tasks.ship_unshipped_orders() order.refresh_from_db() assert order.shipped == datetime(2032, 12, 1, 0, 15)
def test_orders_are_shipped_silently(order, send_happiness_message, settings): settings.SEND_HAPPINESS_MESSAGES = True tasks.ship_unshipped_orders() send_happiness_message.assert_not_called()
def test_only_receiver_gets_notified_during_gift_shipment(order, send_mail): tasks.ship_unshipped_orders() send_mail.assert_called_once()
def test_works(order, ship, product): tasks.ship_unshipped_orders() ship.assert_called_once_with(product, to=order.user, order=order)
def test_orders_are_shipped_silently(order, send_happiness_message, settings): settings.HAPPINESS_MESSAGES_CHAT_ID = 'aaa100500' tasks.ship_unshipped_orders() send_happiness_message.assert_not_called()