Ticket #4051: empty_frozen_set_raises_validation_error.patch

File empty_frozen_set_raises_validation_error.patch, 886 bytes (added by lomin, 14 years ago)

Extends the test of MultipleChoiceField by the case of an empty frozenset

  • tests/regressiontests/forms/fields.py

    diff --git a/tests/regressiontests/forms/fields.py b/tests/regressiontests/forms/fields.py
    index 990a9f7..053071c 100644
    a b class FieldsTests(TestCase):  
    718718        self.assertRaisesErrorWithMessage(ValidationError, "[u'Enter a list of values.']", f.clean, 'hello')
    719719        self.assertRaisesErrorWithMessage(ValidationError, "[u'This field is required.']", f.clean, [])
    720720        self.assertRaisesErrorWithMessage(ValidationError, "[u'This field is required.']", f.clean, ())
     721        self.assertRaisesErrorWithMessage(ValidationError, "[u'This field is required.']", f.clean, frozenset([]))
    721722        self.assertRaisesErrorWithMessage(ValidationError, "[u'Select a valid choice. 3 is not one of the available choices.']", f.clean, ['3'])
    722723
    723724    def test_multiplechoicefield_61(self):
Back to Top