def test_list_subscribe_and_unsubscribe():
    result = chimp.list_subscribe(list_id(), EMAIL_ADDRESS,
                                    {'FIRST': 'unit', 'LAST': 'tests'},
                                    double_optin=False)
    pprint.pprint(result)
    assert result == True

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

    result = chimp.list_unsubscribe(list_id(),
                                    EMAIL_ADDRESS,
                                    delete_member=True,
                                    send_goodbye=False,
                                    send_notify=False)
    pprint.pprint(result)
    assert result == True
dataset/ETHPy150Open divio/django-mailchimp/mailchimp/chimpy/test_chimpy.py/test_list_subscribe_and_unsubscribe/original