def assert_type(type_string, type_expected): type_assigned = MssqlEngineSpec.get_sqla_column_type(type_string) if type_expected is None: self.assertIsNone(type_assigned) else: self.assertIsInstance(type_assigned, type_expected)
def test_mssql_time_expression_mixed_case_column_1y_grain(self): col = column('MixedCase') expr = MssqlEngineSpec.get_timestamp_expr(col, None, 'P1Y') result = str(expr.compile(dialect=mssql.dialect())) self.assertEqual(result, 'DATEADD(year, DATEDIFF(year, 0, [MixedCase]), 0)')