Index: openacs-4/packages/new-portal/tcl/test/new-portal-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/test/new-portal-test-procs.tcl,v diff -u -r1.4.2.7 -r1.4.2.8 --- openacs-4/packages/new-portal/tcl/test/new-portal-test-procs.tcl 25 Feb 2021 12:12:08 -0000 1.4.2.7 +++ openacs-4/packages/new-portal/tcl/test/new-portal-test-procs.tcl 26 Feb 2021 14:02:13 -0000 1.4.2.8 @@ -14,6 +14,8 @@ portal::set_page_pretty_name portal::first_page_p portal::exists_p + portal::list_pages_tcl_list + portal::get_portal_template_id } create_portal_from_template { Create and delete a portal from a template } { @@ -26,22 +28,37 @@ # Create template portal for user # set template_id [portal::create $test_user(user_id)] - set first_page [portal::get_page_id -portal_id $template_id] + set page1 [portal::get_page_id -portal_id $template_id] aa_true "Portal exists" [portal::exists_p $template_id] # - # Create pages + # Create more pages pages # - portal::page_create -pretty_name "Page 2" -portal_id $template_id - portal::page_create -pretty_name "Page 3" -portal_id $template_id + set page2 [portal::page_create \ + -pretty_name "Page 2" \ + -portal_id $template_id] + set page3 [portal::page_create \ + -pretty_name "Page 3" \ + -portal_id $template_id] # # Create another page, to be deleted # set page_to_delete [portal::page_create \ -pretty_name "Page to delete" \ -portal_id $template_id] + # + # Check number of pages + # aa_equals "Number of pages in portal before deletion" \ [portal::page_count -portal_id $template_id] "4" # + # Check page_id list + # + set page_ids [lsort [list $page1 $page2 $page3 $page_to_delete]] + set retrieved_page_ids [lsort [portal::list_pages_tcl_list \ + -portal_id $template_id]] + aa_equals "Check page_ids in portal before deletion" \ + "$retrieved_page_ids" "$page_ids" + # # Get page_id from a portal page # aa_equals "ID of a portal page by name" \ @@ -69,7 +86,7 @@ aa_true "Check for first page in portal" \ [portal::first_page_p \ -portal_id $template_id \ - -page_id $first_page] + -page_id $page1] # # Delete the portal page # @@ -84,6 +101,11 @@ set portal_id_2 [portal::create \ -template_id $template_id $test_user_2(user_id)] # + # Check the template_id of this new portal + # + aa_equals "ID of the portal template of the new portal" \ + [portal::get_portal_template_id $portal_id_2] "$template_id" + # # Make sure the pages exist and are in the same order # set correct_page_count [db_string count_correct_pages "