_acs-tcl__person_procs_test (private)
_acs-tcl__person_procs_test
Defined in packages/acs-tcl/tcl/test/community-core-test-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 {{ set user_id [db_nextval acs_object_id_seq] set username "[ad_generate_random_string]" set email "${username}@mail.test" set password [ad_generate_random_string] set first_names [ad_generate_random_string] set last_name [ad_generate_random_string] array set user_info [auth::create_user -user_id $user_id -username $username -email $email -first_names $first_names -last_name $last_name -password $password -secret_question [ad_generate_random_string] -authority_id [auth::authority::get_id -short_name "acs_testing"] -secret_answer [ad_generate_random_string]] if { $user_info(creation_status) ne "ok" } { # Could not create user error "Could not create test user with username=$username user_info=[array get user_info]" } set user_info(password) $password set user_info(email) $email aa_log "Created user with email=\"$email\" and password=\"$password\" user_id=$user_info(user_id)" aa_run_with_teardown -rollback -test_code { aa_true "party is a person" [person::person_p -party_id $user_id] array set user_inf [person::get -person_id $user_info(user_id)] aa_true "first_names correct" [string match $user_inf(first_names) $first_names] aa_true "last_name correct" [string match $user_inf(last_name) $last_name] aa_true "person_id correct" [string match $user_inf(person_id) $user_id] aa_true "correct name" [string match [person::name -person_id $user_info(user_id)] "$first_names $last_name"] set prs_id [person::new -first_names $first_names -last_name $last_name -email "${email}s"] set email_p [party::email -party_id $prs_id] aa_true "New person pass" [string match $email_p [string tolower "${email}s"]] aa_log "New Person has user_id=$prs_id email_p=$email_p" aa_log "Is this ID in persons ? [db_list _ {select * from persons where person_id=:prs_id}]" aa_log "Is this ID in users ? [db_list _ {select * from cc_users where user_id=:prs_id}]" person::update -person_id $prs_id -first_names "hh$first_names" -last_name "hh$last_name" aa_true "name changed" [string match [person::name -person_id $prs_id] "hh$first_names hh$last_name"] set bio "bio :: [ad_generate_random_string] :: bio" person::update -person_id $prs_id -bio $bio aa_true "bio(graphy) ok" [string match $bio [person::get_bio -person_id $prs_id -exists_var bio_p]] person::delete -person_id $prs_id aa_true "person deleted" ![person::person_p -party_id $prs_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" "person_procs_test (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle