Index: openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl,v diff -u -r1.53 -r1.54 --- openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl 2 Aug 2018 09:29:08 -0000 1.53 +++ openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl 3 Apr 2019 08:27:25 -0000 1.54 @@ -51,28 +51,22 @@ Test the auth::authenticate proc. } { - # Initialize variables - set username "auth_create_user1" - set password "changeme" - aa_run_with_teardown \ -rollback \ -test_code { - array set result [auth::create_user \ - -username $username \ - -email "auth_create_user1@test_user.com" \ - -first_names "Test" \ - -last_name "User" \ - -password $password \ - -secret_question "no_question" \ - -secret_answer "no_answer"] + array set result [acs::test::user::create] + set password $result(password) if { ![aa_equals "creation_status for successful creation" $result(creation_status) "ok"] } { aa_log "Creation result: [array get result]" } - set user_id [acs_user::get_by_username -username $username] + set user [acs_user::get_user_info -user_id $result(user_id)] + set authority_id [dict get $user authority_id] + set username [dict get $user username] + set user_id [acs_user::get_by_username -authority_id $authority_id -username $username] + aa_equals "Username from apis matches" $result(user_id) $user_id ## Portrait api test set old_portrait_id [acs_user::get_portrait_id -user_id $user_id] @@ -97,6 +91,7 @@ # Successful authentication array unset result array set result [auth::authenticate \ + -authority_id $authority_id \ -no_cookie \ -username $username \ -password $password] @@ -110,6 +105,7 @@ array unset auth_info array set auth_info \ [auth::authenticate \ + -authority_id $authority_id \ -no_cookie \ -username $username \ -password "blabla"] @@ -121,6 +117,7 @@ array unset auth_info array set auth_info \ [auth::authenticate \ + -authority_id $authority_id \ -no_cookie \ -username $username \ -password ""] @@ -143,6 +140,7 @@ array unset auth_info array set auth_info \ [auth::authenticate \ + -authority_id $authority_id \ -no_cookie \ -username "" \ -password $password] @@ -171,6 +169,7 @@ array unset auth_info array set auth_info \ [auth::authenticate \ + -authority_id $authority_id \ -no_cookie \ -username $username \ -password $password]