コード例 #1
0
ファイル: test_drafts.py プロジェクト: rskumar/sync-engine
def test_save_update_bad_recipient_draft(db, patch_remote_save_draft,
                                         default_account,
                                         example_bad_recipient_drafts):
    # You should be able to save a draft, even if
    # the recipient's email is invalid.
    from inbox.sendmail.base import create_message_from_json
    from inbox.actions.base import save_draft as save_draft_remote

    for example_draft in example_bad_recipient_drafts:
        draft = create_message_from_json(example_draft,
                                         default_account.namespace, db.session,
                                         is_draft=True)

        save_draft_remote(default_account.id, draft.id, db.session,
                          {'version': draft.version})

    assert len(patch_remote_save_draft) == 2
コード例 #2
0
def test_save_update_bad_recipient_draft(db, patch_remote_save_draft,
                                         default_account,
                                         example_bad_recipient_drafts):
    # You should be able to save a draft, even if
    # the recipient's email is invalid.
    from inbox.sendmail.base import create_message_from_json
    from inbox.actions.base import save_draft as save_draft_remote

    for example_draft in example_bad_recipient_drafts:
        draft = create_message_from_json(example_draft,
                                         default_account.namespace, db.session,
                                         is_draft=True)

        save_draft_remote(default_account.id, draft.id, db.session,
                          {'version': draft.version})

    assert len(patch_remote_save_draft) == 2