def test_sub_var_mysql(self): req = Mock(hdf=dict()) env = EnvironmentStub() env.db = MockMySQLConnection() sql, args = ReportModule(env).sql_sub_vars(req, "'$VAR'", {'VAR': 'value'}) self.assertEqual("concat('', %s, '')", sql) self.assertEqual(['value'], args)
def test_sub_var_mysql(self): env = EnvironmentStub() env.db = MockMySQLConnection() # ditto sql, values, missing_args = ReportModule(env).sql_sub_vars( "'$VAR'", {'VAR': 'value'}) self.assertEqual("concat('', %s, '')", sql) self.assertEqual(['value'], values) self.assertEqual([], missing_args)