# Path: django_toolkit/csv/unicode.py



from django.utils import unittest
from django_toolkit.csv.unicode import UnicodeWriter, UnicodeReader, CastingUnicodeWriter
from tempfile import NamedTemporaryFile
        csv_writer.writerow(['foo', '12'])
        csv_writer.writerow(['bar', '16'])
        f.seek(0)
        actual = f.read()
        expected = ("NAME,AGE\n"
                    "foo,12\n"
                    "bar,16\n")
        self.assertEqual(actual, expected)


class CastingUnicodeWriterTestCase(unittest.TestCase):
 
    def test_write(self):
        f = NamedTemporaryFile(mode='w+')
        csv_writer = CastingUnicodeWriter(f, lineterminator="\n")
        csv_writer.writerow(['NAME', 'AGE', 'THINGS'])
        csv_writer.writerow(['foo', 12, 12.31])
        csv_writer.writerow(['bar', 16, 78.89])
        f.seek(0)
        actual = f.read()
        expected = ("NAME,AGE,THINGS\n"
                    "foo,12,12.31\n"
                    "bar,16,78.89\n")
        self.assertEqual(actual, expected)


class UnicodeReaderWriterTestCase(unittest.TestCase):

    def test_read(self):
        f = NamedTemporaryFile(mode='w+')

# Path: django_toolkit/csv/unicode.py



# Path: django_toolkit/tests/csv/unicode.py
from django.utils import unittest
from django_toolkit.csv.unicode import UnicodeWriter, UnicodeReader, CastingUnicodeWriter
from tempfile import NamedTemporaryFile

        csv_writer.writerow(['foo', '12'])
        csv_writer.writerow(['bar', '16'])
        f.seek(0)
        actual = f.read()
        expected = ("NAME,AGE\n"
                    "foo,12\n"
                    "bar,16\n")
        self.assertEqual(actual, expected)


class CastingUnicodeWriterTestCase(unittest.TestCase):
 
    def test_write(self):
        f = NamedTemporaryFile(mode='w+')
        csv_writer = CastingUnicodeWriter(f, lineterminator="\n")
        csv_writer.writerow(['NAME', 'AGE', 'THINGS'])
        csv_writer.writerow(['foo', 12, 12.31])
        csv_writer.writerow(['bar', 16, 78.89])
        f.seek(0)
        actual = f.read()
        expected = ("NAME,AGE,THINGS\n"
                    "foo,12,12.31\n"
                    "bar,16,78.89\n")
        self.assertEqual(actual, expected)


class UnicodeReaderWriterTestCase(unittest.TestCase):

    def test_read(self):
        f = NamedTemporaryFile(mode='w+')

        csv_writer = UnicodeWriter(f, lineterminator="\n")