diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6593423..309b444 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,10 @@ Changelog --------- - 2012-05-30: v1.1.2 +2012-12-10: v1.1.3 + * Added a parameter to the Move Subscriber method for last followup message number sent. + * to support version 1.0.16 of the API. See https://labs.aweber.com/docs/changelog + +2012-05-30: v1.1.2 * Fixed SSL Certificate validation issue with httplib >= 0.7.0 2011-10-04: v1.1.1 diff --git a/aweber_api/entry.py b/aweber_api/entry.py index aa04e78..6d9f542 100644 --- a/aweber_api/entry.py +++ b/aweber_api/entry.py @@ -43,7 +43,7 @@ def delete(self): self.adapter.request('DELETE', self.url, response='status') return True - def move(self, list_): + def move(self, list_, **kwargs): """Invoke the API method to MOVE an entry resource to a different List. @@ -55,8 +55,9 @@ def move(self, list_): """ params = {'ws.op': 'move', 'list_link': list_.self_link} + params.update(kwargs) response = self.adapter.request('POST', self.url, params, - response='headers') + response='headers') new_resource = response['location'] self._diff = {} diff --git a/setup.py b/setup.py index 0d8e97c..09820ca 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='aweber_api', - version='1.1.2', + version='1.1.3', packages=find_packages(exclude=['tests']), url='https://github.com/aweber/AWeber-API-Python-Library', install_requires = [ diff --git a/tests/test_aweber_entry.py b/tests/test_aweber_entry.py index aab7e50..2ce7fd9 100644 --- a/tests/test_aweber_entry.py +++ b/tests/test_aweber_entry.py @@ -152,9 +152,11 @@ def setUp(self): self.subscriber = self.aweber.load_from_url(subscriber_url) self.subscriber._diff['name'] = 'Joe Schmoe' self.list = self.aweber.load_from_url(new_list_url) + self.move_subscriber() + def move_subscriber(self, **kwargs): self.aweber.adapter.requests = [] - self.resp = self.subscriber.move(self.list) + self.resp = self.subscriber.move(self.list, **kwargs) self.move_req = self.aweber.adapter.requests[0] self.get_req = self.aweber.adapter.requests[1] @@ -182,6 +184,12 @@ def test_should_refresh_subscriber_resource(self): def test_should_reset_diff(self): self.assertEqual(self.subscriber._diff, {}) + def test_should_accept_last_followup_message_number_sent(self): + self.move_subscriber(last_followup_message_number_sent=999) + expected_params = {'ws.op': 'move', 'list_link': self.list.self_link, + 'last_followup_message_number_sent': 999} + + self.assertEqual(self.move_req['data'], expected_params) class TestSavingSubscriberData(SubscriberTestCase):