def test_note_form_sent_email(mock_send_note_confirmation, order_with_lines_and_stock): order = order_with_lines_and_stock note = OrderNote(order=order, user=order.user) form = OrderNoteForm({'content': 'test_note'}, instance=note) form.send_confirmation_email() assert mock_send_note_confirmation.called_once()
def test_note_form_sent_email( mock_send_note_confirmation, order_with_lines_and_stock): order = order_with_lines_and_stock note = OrderNote(order=order, user=order.user) form = OrderNoteForm({'content': 'test_note'}, instance=note) form.send_confirmation_email() assert mock_send_note_confirmation.called_once()
def test_note_form_sent_email(monkeypatch, order_with_lines): mock_send_mail = Mock(return_value=None) monkeypatch.setattr('saleor.dashboard.order.forms.send_note_confirmation', mock_send_mail) note = OrderNote(order=order_with_lines, user=order_with_lines.user) form = OrderNoteForm({'content': 'test_note'}, instance=note) form.send_confirmation_email() assert mock_send_mail.called_once()
def test_note_form_sent_email(monkeypatch, order_with_lines): mock_send_mail = Mock(return_value=None) monkeypatch.setattr( 'saleor.dashboard.order.forms.send_note_confirmation', mock_send_mail) note = OrderNote(order=order_with_lines, user=order_with_lines.user) form = OrderNoteForm({'content': 'test_note'}, instance=note) form.send_confirmation_email() assert mock_send_mail.called_once()