def test_generic_drafts_flag_constrained_by_folder(db, generic_account, folder_role): msg_uid = 22 thread = add_fake_thread(db.session, generic_account.namespace.id) message = add_fake_message(db.session, generic_account.namespace.id, thread) folder = add_fake_folder(db.session, generic_account) add_fake_imapuid(db.session, generic_account.id, message, folder, msg_uid) new_flags = {msg_uid: Flags(('\\Draft', ), None)} update_metadata(generic_account.id, folder.id, folder_role, new_flags, db.session) assert message.is_draft == (folder_role == 'drafts')