Esempio n. 1
0
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")
Esempio n. 2
0
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")
Esempio n. 3
0
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")