'If a form has empty_permitted, no fields should get the CSS class for required.
Django <= 1.8, also check `required` attribute.'

def test_empty_permitted(self):

    if DBS3_SET_REQUIRED_SET_DISABLED:
        required_css_class = u'bootstrap3-req'
        form = TestForm()
        res = render_form_field(u'subject', {u'form': form})
        self.assertIn(required_css_class, res)
        form.empty_permitted = True
        res = render_form_field(u'subject', {u'form': form})
        self.assertNotIn(required_css_class, res)
    else:
        required_css_class = u'bootstrap3-req'
        form = TestForm()
        res = render_form_field(u'subject', {u'form': form})
        self.assertIn(required_css_class, res)
        form.empty_permitted = True
        res = render_form_field(u'subject', {u'form': form})
        self.assertNotIn(required_css_class, res)
