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/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):