示例#1
0
def test_updated_event_synced(opensearch_with_signals):
    """Test that when an event is updated it is synced to OpenSearch."""
    event = EventFactory()
    new_name = 'cat'
    event.name = new_name
    event.save()
    opensearch_with_signals.indices.refresh()

    result = opensearch_with_signals.get(
        index=EventSearchApp.search_model.get_write_index(),
        id=event.pk,
    )
    assert result['_source']['name'] == new_name
示例#2
0
def test_updated_event_synced(es_with_signals):
    """Test that when an event is updated it is synced to ES."""
    event = EventFactory()
    new_name = 'cat'
    event.name = new_name
    event.save()
    es_with_signals.indices.refresh()

    result = es_with_signals.get(
        index=EventSearchApp.es_model.get_write_index(),
        doc_type=DEFAULT_MAPPING_TYPE,
        id=event.pk,
    )
    assert result['_source']['name'] == new_name
def test_updated_event_synced(setup_es):
    """Test that when an event is updated it is synced to ES."""
    event = EventFactory()
    new_name = 'cat'
    event.name = new_name
    event.save()
    setup_es.indices.refresh()

    result = setup_es.get(
        index=EventSearchApp.es_model.get_write_index(),
        doc_type=EventSearchApp.name,
        id=event.pk,
    )
    assert result['_source']['name'] == new_name