예제 #1
0
 def test_datetime_with_mysql(self, registry_plugin):
     report = MigrationReport(registry_plugin.migration, [])
     res = report.init_modify_type(
         [None, None, 'test', 'other', {},
          DATETIME(),
          DATETIME()])
     assert res is True
예제 #2
0
 def test_alter_column_type_with_plugin_4(self, registry_plugin):
     report = MigrationReport(registry_plugin.migration, [])
     report.plugins = [
         MockMigrationColumnTypePluginInteger2StringMySQL,
     ]
     with patch('anyblok.migration.MigrationColumn.alter') as mockapply:
         report.apply_change_modify_type(
             [None, None, 'test', 'other', {},
              Integer(),
              String()])
         mockapply.assert_called()
예제 #3
0
 def test_boolean_with_postgres(self, registry_plugin):
     report = MigrationReport(registry_plugin.migration, [])
     res = report.init_modify_type(
         [None, None, 'test', 'other', {},
          Integer(), Boolean()])
     assert res is False
예제 #4
0
 def test_boolean_with_mssql(self, registry_plugin):
     report = MigrationReport(registry_plugin.migration, [])
     res = report.init_modify_type(
         [None, None, 'test', 'other', {},
          BIT(), Boolean()])
     assert res is True