Ticket #27495: 27495-test.diff

File 27495-test.diff, 970 bytes (added by Tim Graham, 8 years ago)
  • tests/forms_tests/field_tests/test_multiplechoicefield.py

    diff --git a/tests/forms_tests/field_tests/test_multiplechoicefield.py b/tests/forms_tests/field_tests/test_multiplechoicefield.py
    index 85b7049..015e68d 100644
    a b class MultipleChoiceFieldTest(SimpleTestCase):  
    6161        with self.assertRaisesMessage(ValidationError, msg):
    6262            f.clean(['1', '6'])
    6363
     64    def test_multiplechoicefield_4(self):
     65        f = MultipleChoiceField(
     66            choices=[('Numbers', (('1A', 'One'), ('2B', 'Two'))), ('Letters', (('3C', 'A'), ('4D', 'B'))), ('5E', 'Other')]
     67        )
     68        self.assertEqual(['1A'], f.clean(['1A']))
     69        self.assertEqual(['1A', '5E'], f.clean(['1A', '5E']))
     70
    6471    def test_multiplechoicefield_changed(self):
    6572        f = MultipleChoiceField(choices=[('1', 'One'), ('2', 'Two'), ('3', 'Three')])
    6673        self.assertFalse(f.has_changed(None, None))
Back to Top