[Jifty-commit] r3598 - in jifty/branches/virtual-models: . t/TestApp-DatabaseBackedModels/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Jul 1 23:57:26 EDT 2007


Author: sterling
Date: Sun Jul  1 23:57:26 2007
New Revision: 3598

Modified:
   jifty/branches/virtual-models/   (props changed)
   jifty/branches/virtual-models/lib/Jifty/Script/Database.pm
   jifty/branches/virtual-models/t/TestApp-DatabaseBackedModels/t/dump_load.t

Log:
 r7917 at dynpc145:  andrew | 2007-07-01 22:53:40 -0500
 Fixed two problems in the dump_load.t test resulting in premature death of the test.


Modified: jifty/branches/virtual-models/lib/Jifty/Script/Database.pm
==============================================================================
--- jifty/branches/virtual-models/lib/Jifty/Script/Database.pm	(original)
+++ jifty/branches/virtual-models/lib/Jifty/Script/Database.pm	Sun Jul  1 23:57:26 2007
@@ -202,7 +202,7 @@
     while ( my $table = $current_tables->next ) {
         $self->log->debug("Thinking about upgrading table ".$table->name . "(".$table->__uuid .")");
         if ( my $new_table = delete $new_tables->{ $table->__uuid } ) {
-            $self->log->debug("It has the same uuid as tne proposed replacement");
+            $self->log->debug("It has the same UUID as the proposed replacement");
 
             # we have the same table in the db and the dump
             # let's sync its attributes from the dump then sync its columns
@@ -257,7 +257,7 @@
 
         # now we only have tables that were not yet in the database;
     }
-        $self->_upgrade_create_new_tables( $new_tables => $columns );
+    $self->_upgrade_create_new_tables( $new_tables => $columns );
 }
 
 sub _upgrade_create_new_tables {
@@ -270,7 +270,7 @@
         delete $table->{id};
         my $class = Jifty::Model::ModelClass->new();
         my ( $val, $msg ) = $class->create( %{$table}, __uuid => $table_id );
-        die $msg unless ($val) ;
+        die ($msg||'Unknown error during create.') unless ($val) ;
         # Now that we have a brand new model, let's find all its columns
         my @cols = grep { $_->{model_class} = $table->{__uuid} } values %$columns;
         foreach my $col (@cols) {

Modified: jifty/branches/virtual-models/t/TestApp-DatabaseBackedModels/t/dump_load.t
==============================================================================
--- jifty/branches/virtual-models/t/TestApp-DatabaseBackedModels/t/dump_load.t	(original)
+++ jifty/branches/virtual-models/t/TestApp-DatabaseBackedModels/t/dump_load.t	Sun Jul  1 23:57:26 2007
@@ -12,7 +12,7 @@
 use lib 't/lib';
 use Jifty::SubTest;
 
-use Jifty::Test tests => 10;
+use Jifty::Test tests => 22;
 
 
 
@@ -45,6 +45,9 @@
 }
 );
 
+# Make sure we don't modify the schema, if these are missing, the whacked
+$new_widgets{'Jifty::Model::ModelClass'} = $dumped_bootstrap->{'Jifty::Model::ModelClass'};
+$new_widgets{'Jifty::Model::ModelClassColumn'} = $dumped_bootstrap->{'Jifty::Model::ModelClass'};
 
 
 $DATABASE->_load_data(\%new_widgets);


More information about the Jifty-commit mailing list