_acs-authentication__auth_password_reset (private)

 _acs-authentication__auth_password_reset

Defined in packages/acs-authentication/tcl/test/acs-authentication-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
aa_equals aa_equals (public) aa_false aa_false (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_run_with_teardown aa_run_with_teardown (public) _acs-authentication__auth_password_reset _acs-authentication__auth_password_reset _acs-authentication__auth_password_reset->aa_equals _acs-authentication__auth_password_reset->aa_false _acs-authentication__auth_password_reset->aa_log _acs-authentication__auth_password_reset->aa_log_result _acs-authentication__auth_password_reset->aa_run_with_teardown

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    # We don't want email to go out
    aa_stub auth::password::email_password {
        return
    }

    aa_run_with_teardown  -rollback  -test_code {

            set create_result [acs::test::user::create]
            set test_user [acs_user::get -user_id [dict get $create_result user_id]]
            dict set test_user email    [dict get $create_result email]
            dict set test_user password [dict get $create_result password]

            aa_equals "status should be ok for creating user" [dict get $create_result creation_status]  "ok"
            if { [dict get $create_result creation_status] ne "ok" } {
                aa_log "Create-result: '$create_result'"
            }

            set reset_result [auth::password::reset  -authority_id [dict get $test_user authority_id]  -username [dict get $test_user username]]
            aa_equals "status should be ok for resetting password" [dict get $reset_result password_status] "ok"
            aa_true "Result contains new password" [dict exists $reset_result password]

            if { [dict exists $reset_result password] } {
                set auth_result [auth::authentication::authenticate  -username [dict get $test_user username]  -authority_id [dict get $test_user authority_id]  -password [dict get $reset_result password]]
                aa_equals "can authenticate with new password" [dict get $auth_result auth_status] "ok"

                set auth_result [auth::authentication::authenticate  -username [dict get $test_user username]  -authority_id [dict get $test_user authority_id]  -password [dict get $test_user password]]
                aa_false "cannot authenticate with old password" {[dict get $auth_result auth_status] eq "ok"}
            }
            set user_id [acs_user::get_by_username  -authority_id [dict get $test_user authority_id]  -username     [dict get $test_user username]]
            if { $user_id ne "" } {
                acs_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" "auth_password_reset (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: