[Jifty-commit] r4247 - in jifty/trunk: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Oct 17 11:46:17 EDT 2007


Author: jesse
Date: Wed Oct 17 11:46:16 2007
New Revision: 4247

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Test.pm

Log:
 r68164 at pinglin:  jesse | 2007-10-17 16:34:30 +0100
 * Fixing long-broken support for the "JIFTY_FASTTEST" env variable


Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Wed Oct 17 11:46:16 2007
@@ -211,9 +211,7 @@
 	my $booted;
 	if (Jifty->handle && !$@) {
 	    my $baseclass = Jifty->app_class;
-	    my $schema = Jifty::Script::Schema->new;
-	    $schema->prepare_model_classes;
-	    for my $model_class ( grep {/^\Q$baseclass\E::Model::/} $schema->models ) {
+	    for my $model_class ( grep {/^\Q$baseclass\E::Model::/} Jifty::Schema->new->models ) {
 		# We don't want to get the Collections, for example.
 		next unless $model_class->isa('Jifty::DBI::Record');
 		Jifty->handle->simple_query('TRUNCATE '.$model_class->table );
@@ -240,8 +238,7 @@
 
     Jifty->new( no_handle => 1, pre_init => 1 );
 
-    my $schema = Jifty::Script::Schema->new;
-    $schema->{drop_database}     = 1;
+    my $schema = Jifty::Script::Schema->new; $schema->{drop_database}     = 1;
     $schema->{create_database}   = 1;
     $schema->{create_all_tables} = 1;
     $schema->run;
@@ -374,11 +371,16 @@
 
 
 sub _testfile_to_dbname {
+    if ($ENV{JIFTY_FAST_TEST}) {
+        return 'fasttest';
+    }
+    else {
     my $dbname = lc($0);
     $dbname =~ s/\.t$//;
     $dbname =~ s/[-_\.\/\\]//g;
     $dbname = substr($dbname,-32,32);	
     return $dbname;
+    } 
 }
 
 =head2 make_server


More information about the Jifty-commit mailing list