Esempio n. 1
0
contact.set_email_address(test_email)
response = constantcontact.post_contacts(contact)
if printout and response:
    print json.dumps(response, indent = 4, sort_keys = True)
    raw_input('press enter for next test')

print '[test] get_contact by email'
response = constantcontact.get_contacts(email = test_email)
if printout and response:
    print json.dumps(response, indent = 4, sort_keys = True)
    raw_input('press enter for next test')
contact = response['results'][0]
contact_id = contact.get_id()

print '[test] get_contact'
response = constantcontact.get_contact(contact_id)
if printout and response:
    print json.dumps(response, indent = 4, sort_keys = True)
    raw_input('press enter for next test')

print '[test] update_contact'
new_contact = Contact()
new_contact.set_first_name('updated contact name 2')
new_contact.set_email_address(test_email)
new_contact.set_lists(contact.get_lists())
new_contact.set_id(contact.get_id())
response = constantcontact.update_contact(new_contact)
if printout and response:
    print json.dumps(response, indent = 4, sort_keys = True)
    raw_input('press enter for next test')