# Path: select_multiple_field/widgets.py
# HTML_ATTR_CLASS = 'select-multiple-field'
# 
# class SelectMultipleField(widgets.SelectMultiple):
#     """Multiple select widget ready for jQuery multiselect.js"""
# 
#     allow_multiple_selected = True
# 
#     def render(self, name, value, attrs={}, choices=()):
#         rendered_attrs = {'class': HTML_ATTR_CLASS}
#         rendered_attrs.update(attrs)
#         if value is None:
#             value = []
# 
#         final_attrs = self.build_attrs(rendered_attrs, name=name)
#         # output = [u'<select multiple="multiple"%s>' % flatatt(final_attrs)]
#         output = [format_html('<select multiple="multiple"{0}>',
#                               flatatt(final_attrs))]
#         options = self.render_options(choices, value)
#         if options:
#             output.append(options)
# 
#         output.append('</select>')
#         return mark_safe('\n'.join(output))
# 
#     def value_from_datadict(self, data, files, name):
#         """
#         SelectMultipleField widget delegates processing of raw user data to
#         Django's SelectMultiple widget
# 
#         Returns list or None
#         """
#         return super(SelectMultipleField, self).value_from_datadict(
#             data, files, name)


from django.forms import widgets
from django.test import SimpleTestCase
from django.utils.datastructures import MultiValueDict
from select_multiple_field.widgets import (
    HTML_ATTR_CLASS, SelectMultipleField)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals




class SelectMultipleFieldTestCase(SimpleTestCase):

    def setUp(self):
        self.choices = (
            ('a', 'Alpha'),
            ('b', 'Bravo'),
            ('c', 'Charlie'),
        )

    def test_instantiation(self):

# Path: select_multiple_field/widgets.py
# HTML_ATTR_CLASS = 'select-multiple-field'
# 
# class SelectMultipleField(widgets.SelectMultiple):
#     """Multiple select widget ready for jQuery multiselect.js"""
# 
#     allow_multiple_selected = True
# 
#     def render(self, name, value, attrs={}, choices=()):
#         rendered_attrs = {'class': HTML_ATTR_CLASS}
#         rendered_attrs.update(attrs)
#         if value is None:
#             value = []
# 
#         final_attrs = self.build_attrs(rendered_attrs, name=name)
#         # output = [u'<select multiple="multiple"%s>' % flatatt(final_attrs)]
#         output = [format_html('<select multiple="multiple"{0}>',
#                               flatatt(final_attrs))]
#         options = self.render_options(choices, value)
#         if options:
#             output.append(options)
# 
#         output.append('</select>')
#         return mark_safe('\n'.join(output))
# 
#     def value_from_datadict(self, data, files, name):
#         """
#         SelectMultipleField widget delegates processing of raw user data to
#         Django's SelectMultiple widget
# 
#         Returns list or None
#         """
#         return super(SelectMultipleField, self).value_from_datadict(
#             data, files, name)


# Path: test_suite/test_widgets.py
from django.forms import widgets
from django.test import SimpleTestCase
from django.utils.datastructures import MultiValueDict
from select_multiple_field.widgets import (
    HTML_ATTR_CLASS, SelectMultipleField)

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




class SelectMultipleFieldTestCase(SimpleTestCase):

    def setUp(self):
        self.choices = (
            ('a', 'Alpha'),
            ('b', 'Bravo'),
            ('c', 'Charlie'),
        )

    def test_instantiation(self):

        w = SelectMultipleField()