def test_process_should_update_if_action_is_given(factory): doc = factory(name="rue de l'avoine") assert search("rue") doc["_action"] = "update" doc["name"] = "avenue de l'avoine" process(doc) assert search("avenue") assert not search("rue")
def test_process_should_index_by_default(factory): doc = factory(skip_index=True, name="Melicocq") assert not search("Mélicocq") process(doc) assert search("Melicocq")
def test_process_should_deindex_if_action_is_given(factory): doc = factory(name="Mélicocq") assert search("Mélicoq") process({"_action": "delete", "id": doc["id"]}) assert not search("Mélicoq")