Prevent dataform from caching when the form contains a captcha. Fixes bug #11049

This commit is contained in:
Colin Kuskie 2009-10-02 16:14:35 -07:00
parent 26f7dd8bca
commit 0e09072bc0
3 changed files with 34 additions and 3 deletions

View file

@ -36,6 +36,12 @@ my $df = WebGUI::Asset->getImportNode( $session )
fieldConfiguration => '[]',
} );
my $dform = WebGUI::Asset->getDefault($session)->addChild({
className => "WebGUI::Asset::Wobject::DataForm",
mailData => 0,
});
$dform->createField('gotCaptcha', { type => 'Captcha', name => 'humanCheck', });
my $versionTag = WebGUI::VersionTag->getWorking($session);
WebGUI::Test->tagsToRollback($versionTag);
$versionTag->commit;
@ -43,7 +49,7 @@ $versionTag->commit;
#----------------------------------------------------------------------------
# Tests
plan tests => 1; # Increment this number for each test you create
plan tests => 4; # Increment this number for each test you create
#----------------------------------------------------------------------------
# _createForm
@ -60,4 +66,26 @@ $df->_createForm(
is($WebGUI::Test::logger_error, "Unable to load form control - MASSIVE FORM FAILURE", '_createForm logs when it cannot load a form type');
#----------------------------------------------------------------------------
# getContentLastModified
sleep 3;
$df->{_mode} = 'form';
is($df->getContentLastModified, $df->get('lastModified'), 'getContentLastModified: form normally returns lastModified');
$df->{_mode} = 'list';
cmp_ok(
$df->getContentLastModified,
'>',
$df->get('lastModified'),
'... form in list mode does not return lastModified'
);
$dform->{_mode} = 'form';
cmp_ok(
$dform->getContentLastModified,
'>',
$dform->get('lastModified'),
'... form with a captcha does not return lastModified, even in form mode'
);
#vim:ft=perl