

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

dataset/ETHPy150Open charettes/django-colorful/tests/tests.py TestColorFieldWidget.test_render_with_id/original