def test_for_attribute_in_label(self):
        form = SortedForm()
        rendered = str_(form['values'])
        self.assertTrue(' for="id_values_0"' in rendered)

        form = SortedForm(prefix='prefix')
        rendered = str_(form['values'])
        self.assertTrue(' for="id_prefix-values_0"' in rendered)

        # check that it will be escaped properly

        form = SortedForm(prefix='hacking"><a href="TRAP">')
        rendered = str_(form['values'])
        self.assertTrue(' for="id_hacking&quot;&gt;&lt;a href=&quot;TRAP&quot;&gt;-values_0"' in rendered)
dataset/ETHPy150Open gregmuellegger/django-sortedm2m/sortedm2m_tests/test_forms.py/TestSortedFormField.test_for_attribute_in_label/original