Beispiel #1
0
 def setUp(self):
     self.migration_config = {
         'migration_repo_path': '.',
         'db_url': 'sqlite://'
     }
     self.migrate = ext_migrate.MigrateExtension(self.migration_config)
     super(TestMigrateExtension, self).setUp()
Beispiel #2
0
 def test_change_init_version(self, migration):
     self.migration_config['init_version'] = 101
     migrate = ext_migrate.MigrateExtension(self.migration_config)
     migrate.downgrade(None)
     migration.db_sync.assert_called_once_with(
         migrate.engine,
         self.migrate.repository,
         self.migration_config['init_version'],
         init_version=self.migration_config['init_version'])
 def setUp(self):
     self.migration_config = {
         'migration_repo_path': '.',
         'db_url': 'sqlite://'
     }
     self.engine = sqlalchemy.create_engine(self.migration_config['db_url'])
     self.migrate = ext_migrate.MigrateExtension(self.engine,
                                                 self.migration_config)
     super(TestMigrateExtension, self).setUp()
Beispiel #4
0
 def test_check_enabled_false(self, migration):
     self.migration_config['migration_repo_path'] = ''
     migrate = ext_migrate.MigrateExtension(self.migration_config)
     self.assertFalse(migrate.enabled)