def test_list_batch_subscribe_and_batch_unsubscribe():
    batch = [{'EMAIL':EMAIL_ADDRESS,'EMAIL_TYPE':'html'},
             {'EMAIL':EMAIL_ADDRESS2,'EMAIL_TYPE':'text'}]

    result = chimp.list_batch_subscribe(list_id(),
                                        batch,
                                        double_optin=False,
                                        update_existing=False,
                                        replace_interests=False)
    assert result['add_count'] == 2

    members = chimp.list_members(list_id())['data']
    emails = map(lambda x: x['email'], members)
    assert EMAIL_ADDRESS in emails
    assert EMAIL_ADDRESS2 in emails

    result = chimp.list_batch_unsubscribe(list_id(),
                                          [EMAIL_ADDRESS,EMAIL_ADDRESS2],
                                          delete_member=True,
                                          send_goodbye=False,
                                          send_notify=False)
    assert result['success_count'] == 2
dataset/ETHPy150Open divio/django-mailchimp/mailchimp/chimpy/test_chimpy.py/test_list_batch_subscribe_and_batch_unsubscribe/original