Index: openacs-4/packages/xotcl-core/tcl/test/xotcl-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/test/Attic/xotcl-test-procs.tcl,v diff -u -N -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/xotcl-core/tcl/test/xotcl-test-procs.tcl 17 Apr 2019 12:38:14 -0000 1.1.2.7 +++ openacs-4/packages/xotcl-core/tcl/test/xotcl-test-procs.tcl 17 Apr 2019 14:54:10 -0000 1.1.2.8 @@ -68,6 +68,7 @@ set new_context_id [::xo::dc get_value get_context_id { select min(object_id) from acs_objects where object_id <> :object_id + and object_id <> :old_context_id }] aa_log "Setting a different context_id: $new_context_id" $orm_object set context_id $new_context_id @@ -200,6 +201,7 @@ set new_context_id [::xo::dc get_value get_context_id { select min(object_id) from acs_objects where object_id <> :object_id + and object_id <> :old_context_id }] aa_log "Setting a different context_id: $new_context_id" $orm_object set context_id $new_context_id @@ -243,13 +245,29 @@ select title from cr_revisions where revision_id = :revision_id }] + + + aa_section "Check modifications BEFORE refetching" + aa_equals "title was updated" [$orm_object set title] $new_title + aa_equals "context_id was updated" [$orm_object set context_id] $new_context_id foreach att $attributes { if {![aa_equals "Attribute $att in the object matches database value" [set $att] [$orm_object set $att]]} { aa_log "DB: [set $att]| ORM: [$orm_object set $att]" } } + aa_section "Check modifications AFTER refetching" + aa_log "Fetching object again from ORM" + set orm_object [::xo::db::CrItem get_instance_from_db -item_id $object_id] + aa_equals "title was updated" [$orm_object set title] $new_title + aa_equals "context_id was updated" [$orm_object set context_id] $new_context_id + foreach att $attributes { + if {![aa_equals "Attribute $att in the object matches database value" [set $att] [$orm_object set $att]]} { + aa_log "DB: [set $att]| ORM: [$orm_object set $att]" + } + } + aa_section "Object deletion" $orm_object delete set orm_exists_p [::xo::db::Class exists_in_db -id $object_id]