diff --git a/t/Asset/AssetLineage.t b/t/Asset/AssetLineage.t index 4f424d652..10af88b17 100644 --- a/t/Asset/AssetLineage.t +++ b/t/Asset/AssetLineage.t @@ -57,6 +57,7 @@ my $folder2 = $topFolder->addChild({ }); my $editor = WebGUI::User->new($session, 'new'); +WebGUI::Test->usersToDelete($editor); $editor->addToGroups([4]); my @snippets = (); @@ -531,7 +532,4 @@ END { foreach my $tag ($versionTag, $vTag2) { $tag->rollback; } - foreach my $account ($editor) { - (defined $account and ref $account eq 'WebGUI::User') and $account->delete; - } } diff --git a/t/Asset/Event/edit.t b/t/Asset/Event/edit.t index be21874e9..ef1d792c4 100644 --- a/t/Asset/Event/edit.t +++ b/t/Asset/Event/edit.t @@ -36,6 +36,7 @@ $session->setting->set( 'defaultVersionTagWorkflow', 'pbworkflow000000000003' ); # Create a user for testing purposes my $user = WebGUI::User->new( $session, "new" ); +WebGUI::Test->usersToDelete($user); $user->username( 'dufresne' . time ); my $identifier = 'ritahayworth'; my $auth = WebGUI::Operation::Auth::getInstance( $session, $user->authMethod, $user->userId ); @@ -169,7 +170,6 @@ END { $tag->rollback; } - $user->delete; } #---------------------------------------------------------------------------- diff --git a/t/Asset/Event/permissions.t b/t/Asset/Event/permissions.t index a6ea233e3..393e34384 100644 --- a/t/Asset/Event/permissions.t +++ b/t/Asset/Event/permissions.t @@ -33,6 +33,7 @@ push @versionTags, WebGUI::VersionTag->getWorking($session); $versionTags[-1]->set({name=>"Photo Test, add Gallery, Album and 1 Photo"}); my $registeredUser = WebGUI::User->new( $session, "new" ); +WebGUI::Test->usersToDelete($registeredUser); # Make a Calendar to add events do my $calendar = $node->addChild({ @@ -82,5 +83,4 @@ END { for my $tag ( @versionTags ) { $tag->rollback; } - $registeredUser->delete; } diff --git a/t/Asset/Post/permission.t b/t/Asset/Post/permission.t index 073722c77..57f4a9bfa 100644 --- a/t/Asset/Post/permission.t +++ b/t/Asset/Post/permission.t @@ -30,6 +30,7 @@ my $node = WebGUI::Asset->getImportNode( $session ); my %user; $user{"2"} = WebGUI::User->new( $session, "new" ); +WebGUI::Test->usersToDelete($user{'2'}); $user{"2"}->addToGroups( ['2'] ); # Registered user my $versionTag = WebGUI::VersionTag->getWorking( $session ); @@ -93,8 +94,7 @@ $maker->prepare( { #---------------------------------------------------------------------------- # Cleanup END { - for my $user ( values %user ) { - $user->delete; - } + my $subscriptionGroup = WebGUI::Group->new($session, $thread->get('subscriptionGroupId')); + WebGUI::Test->groupsToDelete($subscriptionGroup); $versionTag->rollback; } diff --git a/t/Asset/Redirect/mech.t b/t/Asset/Redirect/mech.t index b23af0c81..4d28bd529 100644 --- a/t/Asset/Redirect/mech.t +++ b/t/Asset/Redirect/mech.t @@ -36,6 +36,7 @@ $session->setting->set( 'specialState', '' ); # Create a user for testing purposes my $user = WebGUI::User->new( $session, "new" ); +WebGUI::Test->usersToDelete($user); $user->username( 'dufresne' ); my $identifier = 'ritahayworth'; my $auth = WebGUI::Operation::Auth::getInstance( $session, $user->authMethod, $user->userId ); @@ -176,5 +177,4 @@ END { $tag->rollback; } - $user->delete; } diff --git a/t/Auth/mech.t b/t/Auth/mech.t index 6a38b7bdc..ed7755271 100644 --- a/t/Auth/mech.t +++ b/t/Auth/mech.t @@ -43,6 +43,7 @@ $session->setting->set( 'specialState', '' ); my $USERNAME = 'dufresne'; my $IDENTIFIER = 'ritahayworth'; my $user = WebGUI::User->new( $session, "new", "something new" ); +WebGUI::Test->usersToDelete($user); $user->username( $USERNAME ); $user->addToGroups( ['3'] ); my $auth = WebGUI::Operation::Auth::getInstance( $session, $user->authMethod, $user->userId ); @@ -276,5 +277,4 @@ $mech->base_is( $assetUrl, "We don't get redirected" ); #---------------------------------------------------------------------------- # Cleanup END { - $user->delete; }