

def test_render_with_colors(self):
    widget = ColorFieldWidget(colors=['#ffffff', '#223344', '#557799'])
    self.assertIn('<input id="id_test" list="datalist_for_id_test" name="test" type="color" value="#123456" />', widget.render('test', '#123456'))
    widget.assertIn('<script type="text/javascript">\n                    (function($){\n                        $(document).ready(function(){\n                            $(\'#id_test\').each(function(i, elm){\n                                // Make sure html5 color element is not replaced\n                                if (elm.type != \'color\') $(elm).colorPicker({"colors": ["ffffff", "223344", "557799"]});\n                            });\n                        });\n                    })(\'django\' in window && django.jQuery ? django.jQuery: jQuery);\n                </script>\n                ', widget.render('test', '#123456'))

dataset/ETHPy150Open charettes/django-colorful/tests/tests.py TestColorFieldWidget.test_render_with_colors/VarMisuse@41/97 `self`->`widget`