Ticket #12030: new_tests.diff

File new_tests.diff, 928 bytes (added by elbarto, 14 years ago)

Added new tests.

  • tests/modeltests/model_forms/tests.py

     
    4141    def test_notrequired_overrides_notblank(self):
    4242        form = CustomWriterForm({})
    4343        assert form.is_valid()
     44    def test_maxvalue_positiveinteger_field(self):
     45        form = PriceForm(data={'price': '100', 'quantity': '0'})
     46        assert form.is_valid()
     47        form = PriceForm(data={'price': '100', 'quantity': '4294967295'})
     48        assert form.is_valid()
     49        form = PriceForm(data={'price': '100', 'quantity': '-1'})
     50        self.assertFalse(form.is_valid())
     51        form = PriceForm(data={'price': '100', 'quantity': '4294967296'})
     52        self.assertFalse(form.is_valid())
    4453
    4554# unique/unique_together validation
    4655class UniqueTest(TestCase):
Back to Top