#NEWLINE# def testPostUpdateAndDeleteCalendar( self ) : #NEWLINE# #INDENT# 'Test posting a new calendar, updating it, deleting it' #NEWLINE# self . cal_client . ProgrammaticLogin ( ) #NEWLINE# title = 'Little League Schedule' #NEWLINE# description = 'This calendar contains practice and game times' #NEWLINE# time_zone = 'America/Los_Angeles' #NEWLINE# hidden = False #NEWLINE# location = 'Oakland' #NEWLINE# color = '#2952A3' #NEWLINE# calendar = gdata . calendar . CalendarListEntry ( ) #NEWLINE# calendar . title = atom . Title ( text = title ) #NEWLINE# calendar . summary = atom . Summary ( text = description ) #NEWLINE# calendar . where = gdata . calendar . Where ( value_string = location ) #NEWLINE# calendar . color = gdata . calendar . Color ( value = color ) #NEWLINE# calendar . timezone = gdata . calendar . Timezone ( value = time_zone ) #NEWLINE# if hidden : #NEWLINE# #INDENT# calendar . hidden = gdata . calendar . Hidden ( value = 'true' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# calendar . hidden = gdata . calendar . Hidden ( value = 'false' ) #NEWLINE# #UNINDENT# new_calendar = self . cal_client . InsertCalendar ( new_calendar = calendar ) #NEWLINE# self . assertEquals ( title , new_calendar . title . text ) #NEWLINE# self . assertEquals ( description , new_calendar . summary . text ) #NEWLINE# self . assertEquals ( location , new_calendar . where . value_string ) #NEWLINE# self . assertEquals ( color , new_calendar . color . value ) #NEWLINE# self . assertEquals ( time_zone , new_calendar . timezone . value ) #NEWLINE# if hidden : #NEWLINE# #INDENT# self . assertEquals ( 'true' , new_calendar . hidden . value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEquals ( 'false' , new_calendar . hidden . value ) #NEWLINE# #UNINDENT# calendar_to_update = self . cal_client . GetCalendarListEntry ( new_calendar . id . text ) #NEWLINE# updated_title = 'This is the updated title' #NEWLINE# calendar_to_update . title . text = updated_title #NEWLINE# updated_calendar = self . cal_client . UpdateCalendar ( calendar_to_update ) #NEWLINE# self . assertEquals ( updated_title , updated_calendar . title . text ) #NEWLINE# calendar_to_delete = self . cal_client . GetCalendarListEntry ( new_calendar . id . text ) #NEWLINE# self . cal_client . Delete ( calendar_to_delete . GetEditLink ( ) . href ) #NEWLINE# return new_calendar