def test_unsuccessful_creation(self): error_message = 'Whoops!' exception = HubspotClientError(error_message, get_uuid4_str()) simulator = UnsuccessfulCreateProperty(STUB_NUMBER_PROPERTY, exception) with assert_raises_regexp(HubspotClientError, error_message): with MockPortalConnection(simulator) as connection: create_property(STUB_NUMBER_PROPERTY, connection)
def test_unsuccessful_creation(self): property_group = PropertyGroup(self._PROPERTY_GROUP_NAME) exception = HubspotClientError('Whoops!', get_uuid4_str()) simulator = UnsuccessfulCreatePropertyGroup(property_group, exception) with assert_raises_regexp(HubspotClientError, str(exception)): with MockPortalConnection(simulator) as connection: create_property_group(property_group, connection)
def _get_contact_profiles_data(contact): contact_profile_data = { 'vid': contact.vid, 'identities': [ {'type': 'LEAD_GUID', 'value': get_uuid4_str()}, {'type': 'EMAIL', 'value': contact.email_address}, ], } contact_profiles_data = [contact_profile_data] for vid in contact.related_contact_vids: contact_profiles_data.append({'vid': vid, 'identities': []}) return contact_profiles_data
def _get_contact_profiles_data(contact): contact_profile_data = { "vid": contact.vid, "identities": [ {"type": "LEAD_GUID", "value": get_uuid4_str()}, {"type": "EMAIL", "value": contact.email_address}, ], } contact_profiles_data = [contact_profile_data] for vid in contact.related_contact_vids: contact_profiles_data.append({"vid": vid, "identities": []}) return contact_profiles_data
def _get_random_email_address(): email_user_name = get_uuid4_str() email_address = email_user_name + "@example.com" return email_address
def _get_random_email_address(): email_user_name = get_uuid4_str() email_address = email_user_name + '@example.com' return email_address