From b3e9cee24a3f40a3a1bbbfa08976218b096c14a9 Mon Sep 17 00:00:00 2001 From: Francisco Ruiz Date: Thu, 10 Apr 2014 16:31:15 +0100 Subject: [PATCH] Added response data maker for property deletion --- hubspot/contacts/testing.py | 3 +++ tests/test_properties.py | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hubspot/contacts/testing.py b/hubspot/contacts/testing.py index 20f11d4..fc5bd3b 100644 --- a/hubspot/contacts/testing.py +++ b/hubspot/contacts/testing.py @@ -239,3 +239,6 @@ def _format_data_for_property_group(property_group): def _format_data_for_properties(properties): properties_data = [format_data_for_property(p) for p in properties] return properties_data + + +PROPERTY_DELETION_RESPONSE_DATA_MAKER = NULL_RESPONSE_DATA_MAKER diff --git a/tests/test_properties.py b/tests/test_properties.py index 443c7a4..b5f9b1d 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -14,15 +14,14 @@ # ############################################################################## -from nose.tools import assert_in -from nose.tools import assert_raises -from nose.tools import eq_ - -from voluptuous import MultipleInvalid from hubspot.connection.exc import HubspotClientError from hubspot.connection.testing import ConstantResponseDataMaker from hubspot.connection.testing import MockPortalConnection from hubspot.connection.testing import RemoteMethod +from nose.tools import assert_in +from nose.tools import assert_raises +from nose.tools import eq_ +from voluptuous import MultipleInvalid from hubspot.contacts.generic_utils import get_uuid4_str from hubspot.contacts.properties import BooleanProperty @@ -37,6 +36,7 @@ from hubspot.contacts.request_data_formatters.properties import \ format_data_for_property from hubspot.contacts.testing import AllPropertiesRetrievalResponseDataMaker +from hubspot.contacts.testing import PROPERTY_DELETION_RESPONSE_DATA_MAKER from hubspot.contacts.testing import PropertyCreationRetrievalResponseDataMaker from tests.utils import BaseMethodTestCase @@ -223,7 +223,9 @@ class TestPropertyDeletion(BaseMethodTestCase): _REMOTE_METHOD = RemoteMethod('/properties/' + _PROPERTY_NAME, 'DELETE') def test_existing_mutable_property(self): - connection = MockPortalConnection() + connection = MockPortalConnection({ + self._REMOTE_METHOD: PROPERTY_DELETION_RESPONSE_DATA_MAKER, + }) delete_property(self._PROPERTY_NAME, connection) self._assert_expected_remote_method_used(connection)