# Path: select_multiple_field/codecs.py
# def decode_csv_to_list(encoded):
#     """
#     Decodes a delimiter separated string to a Python list
#     """
#     delimiter = getattr(
#         settings, 'SELECTMULTIPLEFIELD_DELIMITER', DEFAULT_DELIMITER)
#     if encoded == '':
#         return []
# 
#     decoded = sorted(set(encoded.split(delimiter)))
#     return decoded
# 
# def encode_list_to_csv(decoded):
#     """
#     Encodes a Python list to a delimiter separated string
# 
#     Note: This sorts the list lexicographically
#     """
#     delimiter = getattr(
#         settings, 'SELECTMULTIPLEFIELD_DELIMITER', DEFAULT_DELIMITER)
#     decoded = sorted(set(decoded))
#     return delimiter.join(decoded)


from django.test import SimpleTestCase
from select_multiple_field.codecs import (
    decode_csv_to_list, encode_list_to_csv)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals




class CodecTestCase(SimpleTestCase):

    def setUp(self):
        self.choices = (
            ('a', 'Alpha'),
            ('b', 'Bravo'),
            ('c', 'Charlie'),
        )
        self.test_list = ['a', 'b', 'c']
        self.test_encoded = 'a,b,c'
        self.wild_delimiter = 'シ'
        self.test_encoded_alt = 'aシbシc'

    def test_decoder(self):

# Path: select_multiple_field/codecs.py
# def decode_csv_to_list(encoded):
#     """
#     Decodes a delimiter separated string to a Python list
#     """
#     delimiter = getattr(
#         settings, 'SELECTMULTIPLEFIELD_DELIMITER', DEFAULT_DELIMITER)
#     if encoded == '':
#         return []
# 
#     decoded = sorted(set(encoded.split(delimiter)))
#     return decoded
# 
# def encode_list_to_csv(decoded):
#     """
#     Encodes a Python list to a delimiter separated string
# 
#     Note: This sorts the list lexicographically
#     """
#     delimiter = getattr(
#         settings, 'SELECTMULTIPLEFIELD_DELIMITER', DEFAULT_DELIMITER)
#     decoded = sorted(set(decoded))
#     return delimiter.join(decoded)


# Path: test_suite/test_codecs.py
from django.test import SimpleTestCase
from select_multiple_field.codecs import (
    decode_csv_to_list, encode_list_to_csv)

# -*- coding: utf-8 -*-
from __future__ import unicode_literals




class CodecTestCase(SimpleTestCase):

    def setUp(self):
        self.choices = (
            ('a', 'Alpha'),
            ('b', 'Bravo'),
            ('c', 'Charlie'),
        )
        self.test_list = ['a', 'b', 'c']
        self.test_encoded = 'a,b,c'
        self.wild_delimiter = 'シ'
        self.test_encoded_alt = 'aシbシc'

    def test_decoder(self):

        decoded = decode_csv_to_list(self.test_encoded)