Ejemplo n.º 1
0
    def test_cont_setter_getter(self):
        contact = Contact()

        contact.set_first_name('Mabel')
        contact.set_last_name('Pines')
        contact.set_company_name('The Mystery hack')

        self.assertEqual(contact.get_job_title(), None)
        self.assertEqual(contact.get_first_name(), 'Mabel')
        self.assertEqual(contact.get_last_name(), 'Pines')

        contact.delete_last_name()

        self.assertEqual(contact.get_last_name(), None)
Ejemplo n.º 2
0
    def test_cont_setter_getter(self):
        contact = Contact()

        contact.set_first_name("Mabel")
        contact.set_last_name("Pines")
        contact.set_company_name("The Mystery hack")

        self.assertEqual(contact.get_job_title(), None)
        self.assertEqual(contact.get_first_name(), "Mabel")
        self.assertEqual(contact.get_last_name(), "Pines")

        contact.delete_last_name()

        self.assertEqual(contact.get_last_name(), None)
Ejemplo n.º 3
0
print '[test] get_events'
response = constantcontact.get_events(limit = 3)
if printout and response:
    print json.dumps(response, indent = 4, sort_keys = True)
    raw_input('press enter for next test')

start_date = (datetime.now() + timedelta(hours=6)).replace(minute=0)
end_date = (datetime.now() + timedelta(days=5)).replace(minute=0)

verified_email_address = constantcontact.get_verified_email_addresses('CONFIRMED')[0]['email_address']

contact = Contact()
contact.set_email_address(verified_email_address)
contact.set_first_name('Bob')
contact.set_company_name('Justice League')
contact.set_work_phone('8675309')

event = Event()
event.set_end_date(end_date.isoformat())
event.set_name('Test event '+str(randint(1000000, 9999999)))
event.set_title('please ignore')
event.set_contact(contact)
event.set_location('THE SECRET MOONBASE')
event.set_time_zone_id('US/Eastern')
event.set_type('OTHER')
event.set_start_date(start_date.isoformat())

print '[test] post_events'
response = constantcontact.post_events(event)
if printout and response: