# the automated test:
aa_register_case -cats {smoke} creating_a_site {
this finds out if there is any problem with creating a site,
and having created one, is everything pointed correctly
@author jiml Jim Lynch
} {
aa_run_with_teardown -test_code {
set root_node_id [site_node::get_node_id -url "/"]
set nod_nam "aaaa-[ns_mktemp XXXXXX]"
set my_node_id \
[site_node::new \
-name $nod_nam \
-parent_id $root_node_id]
set my_pkg_id \
[site_node::instantiate_and_mount \
-package_key website \
-node_name $nod_nam \
-context_id $root_node_id]
aa_true site_row_exists [db_0or1row get_site {
select
sts.site_id
from
simple_twopage_sites sts
where
sts.package_id = :my_pkg_id
}]
# site should now exist. do stuff to it
# (nothing here yet)
# now tear down site.
#db_0or1row delete_site {
# select
# website__delete(:site_id)
#}
site_node_delete_package_instance -node_id $my_node_id
aa_false site_gone [db_0or1row site_gone_test {
select
o.object_id
from
acs_objects o
where
o.object_id = :site_id
}]
} -teardown_code {
site_node::update_cache \
-node_id [site_node::get_node_id -url "/"]
}
}