_calendar__a_foreign_calendar_user (private)
_calendar__a_foreign_calendar_user
Defined in packages/calendar/tcl/test/cal-item-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ # # The user timezone may be cached. To avoid any # caching-related behavior, we create a fresh test user. # set user_id [dict get [acs::test::user::create -admin] user_id] aa_run_with_teardown -rollback -test_code { set calendar_id [calendar::create $user_id t] # # Set the timezone to anything that is not the system # timezone. This should be sufficient to trigger an # attempt to convert the calendar item dates. # set system_timezone [lang::system::timezone] set foreign_timezone [db_string get_timezone { select min(tz) from timezones where tz <> :system_timezone }] db_dml set_timezone { update user_preferences set timezone = :foreign_timezone where user_id = :user_id } # # Now try to create a calendar item with various date # formats and make sure that we do not trigger an # error. # foreach {start_date end_date} { 2020-01-01 2020-12-31 "2020-01-01 01:00" "2020-12-31 02:00" "2020-01-01 01:00:03" "2020-12-31 02:00:04" } { set fail_p [catch { calendar::item::new -start_date $start_date -end_date $end_date -name "Foreign calendar item" -description "Foreign calendar item" -calendar_id $calendar_id } errmsg] aa_false "Creating calendar item in timezone '$foreign_timezone', '$start_date' -> '$end_date'" $fail_p if {$fail_p} { aa_log $errmsg } } } -teardown_code { acs::test::user::delete -user_id $user_id } }} { aa_log "Running testcase body $body_count" set ::__aa_test_indent [info level] set catch_val [catch $testcase_body msg] if {$catch_val != 0 && $catch_val != 2} { aa_log_result "fail" "a_foreign_calendar_user (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle