def test_updated_interaction_synced(opensearch_with_signals): """Test that when an interaction is updated it is synced to OpenSearch.""" interaction = CompanyInteractionFactory() new_subject = 'pluto' interaction.subject = new_subject interaction.save() opensearch_with_signals.indices.refresh() result = opensearch_with_signals.get( index=InteractionSearchApp.search_model.get_write_index(), id=interaction.pk, ) assert result['_source']['subject'] == new_subject
def test_updated_interaction_synced(es_with_signals): """Test that when an interaction is updated it is synced to ES.""" interaction = CompanyInteractionFactory() new_subject = 'pluto' interaction.subject = new_subject interaction.save() es_with_signals.indices.refresh() result = es_with_signals.get( index=InteractionSearchApp.es_model.get_write_index(), doc_type=DEFAULT_MAPPING_TYPE, id=interaction.pk, ) assert result['_source']['subject'] == new_subject
def test_updated_interaction_synced(setup_es): """Test that when an interaction is updated it is synced to ES.""" interaction = CompanyInteractionFactory() new_subject = 'pluto' interaction.subject = new_subject interaction.save() setup_es.indices.refresh() result = setup_es.get( index=InteractionSearchApp.es_model.get_write_index(), doc_type=InteractionSearchApp.name, id=interaction.pk, ) assert result['_source']['subject'] == new_subject