Change tests to use the automatic backup of Settings in END blocks.

This commit is contained in:
Colin Kuskie 2009-03-30 20:41:02 +00:00
parent 6f3aae261b
commit 4e78593395
23 changed files with 13 additions and 93 deletions

View file

@ -34,12 +34,9 @@ my $node = WebGUI::Asset->getImportNode( $session );
my @versionTags = ( WebGUI::VersionTag->getWorking( $session ) );
# Override some settings to make things easier to test
my %oldSettings;
# userFunctionStyleId
$oldSettings{ userFunctionStyleId } = $session->setting->get( 'userFunctionStyleId' );
$session->setting->set( 'userFunctionStyleId', 'PBtmpl0000000000000132' );
# specialState
$oldSettings{ specialState } = $session->setting->get( 'specialState' );
$session->setting->set( 'specialState', '' );
# Create a user for testing purposes
@ -280,8 +277,4 @@ $mech->base_is( $assetUrl, "We don't get redirected" );
# Cleanup
END {
$user->delete;
for my $key ( keys %oldSettings ) {
$session->setting->set( $key, $oldSettings{ $key } );
}
}