#23547: BooleanField that is required and have value False always will raise
ValidationError
-----------------------------------+--------------------------------------
     Reporter:  Lagovas            |                    Owner:  nobody
         Type:  Bug                |                   Status:  new
    Component:  Forms              |                  Version:  1.6
     Severity:  Normal             |               Resolution:
     Keywords:  Form BooleanField  |             Triage Stage:  Unreviewed
    Has patch:  1                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------

Comment (by timgraham):

 The tests do not pass with your proposed change:
 {{{
 ======================================================================
 FAIL: test_booleanfield
 (forms_tests.tests.test_error_messages.FormsErrorMessagesTestCase)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File
 "/home/tim/code/django/tests/forms_tests/tests/test_error_messages.py",
 line 169, in test_booleanfield
     self.assertFormErrors(['REQUIRED'], f.clean, '')
   File
 "/home/tim/code/django/tests/forms_tests/tests/test_error_messages.py",
 line 23, in assertFormErrors
     self.fail("Testing the 'clean' method on %s failed to raise a
 ValidationError.")
 AssertionError: Testing the 'clean' method on %s failed to raise a
 ValidationError.

 ======================================================================
 FAIL: test_booleanfield_1 (forms_tests.tests.test_fields.FieldsTests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/tim/code/django/tests/forms_tests/tests/test_fields.py",
 line 891, in test_booleanfield_1
     self.assertRaisesMessage(ValidationError, "'This field is required.'",
 f.clean, '')
   File "/home/tim/code/django/django/test/testcases.py", line 579, in
 assertRaisesMessage
     re.escape(expected_message), callable_obj, *args, **kwargs)
   File "/home/tim/code/django/django/utils/six.py", line 690, in
 assertRaisesRegex
     return getattr(self, _assertRaisesRegex)(*args, **kwargs)
 AssertionError: ValidationError not raised
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23547#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.bad3091b9ea7f6212d7ead1b20875b85%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to