Committer: nnikulochkina
LJSUP-14164: Unit tests infrastructureU trunk/cgi-bin/LJ/Test.pm
Modified: trunk/cgi-bin/LJ/Test.pm =================================================================== --- trunk/cgi-bin/LJ/Test.pm 2012-11-20 09:10:13 UTC (rev 23331) +++ trunk/cgi-bin/LJ/Test.pm 2012-11-20 10:21:13 UTC (rev 23332) @@ -303,7 +303,10 @@ my $class = shift; my %opts = @_; $opts{access} ||= []; - my $app = $opts{app} or die "Application is not specified"; + my $app = $opts{app} ? + $opts{app} : + LJ::UserApps::Application->new( id => $opts{application_id} ); + die "Application is not specified" unless $app; $app->authorize( userid => $opts{userid}, access => $opts{access} ); my $token = LJ::OAuth::AccessToken->generate( consumer_key => $opts{consumer_key},