def test_custom_delimiter(self): q = SimpleQueryFactory(sql='select 1, 2') exporter = CSVExporter(query=q) res = exporter.get_output(delim='|') self.assertEqual(res, '1|2\r\n1|2\r\n')
def test_custom_delimiter(self): q = SimpleQueryFactory(sql="select 1, 2") exporter = CSVExporter(query=q) res = exporter.get_output(delim="|") self.assertEqual(res, "1|2\r\n1|2\r\n")
def test_writing_bom(self): q = SimpleQueryFactory(sql='select 1, 2') exporter = CSVExporter(query=q) res = exporter.get_output() self.assertEqual(res, '\ufeff1,2\r\n1,2\r\n')