def test_get_contact_by_business_identifier(session): # pylint:disable=unused-argument """Assert that a contact can be retrieved by the associated business id.""" entity_model = factory_entity_model() entity = EntityService(entity_model) entity.add_contact(TestContactInfo.contact1) contact = entity.get_contact() assert contact is not None assert contact.email == TestContactInfo.contact1['email']
def test_get_contact_by_business_identifier(session): # pylint:disable=unused-argument """Assert that a contact can be retrieved by the associated business id.""" entity_model = factory_entity_model(business_identifier='CP1234567') entity = EntityService(entity_model) entity.add_contact(TEST_CONTACT_INFO) contact = entity.get_contact() assert contact is not None assert contact.email == TEST_CONTACT_INFO['email']
def test_get_contact_by_business_identifier_no_contact(session): # pylint:disable=unused-argument """Assert that a contact cannot be retrieved from an entity with no contact.""" entity_model = factory_entity_model() entity = EntityService(entity_model) contact = entity.get_contact() assert contact is None