Ticket #6492: django-isvalidfloat-test.diff

File django-isvalidfloat-test.diff, 684 bytes (added by Bastian Kleineidam <calvin@…>, 17 years ago)

unittest for isValidFloat() unicode fix

  • tests/modeltests/manipulators/models.py

    commit 46a7071b833f825a660d7e95248c4d0f1dddf4f1
    Author: Bastian Kleineidam <calvin@debian.org>
    Date:   Fri Feb 1 10:44:55 2008 +0100
    
        Add unit test for isValidFloat() Unicode fix.
    
    diff --git a/tests/modeltests/manipulators/models.py b/tests/modeltests/manipulators/models.py
    index 2ee81f6..12f3030 100644
    a b True  
    8888<Album: Ultimate Ella>
    8989>>> a2.release_date
    9090datetime.date(2005, 2, 13)
     91
     92# Test isValidFloat Unicode coercion
     93>>> from django.core.validators import isValidFloat, ValidationError
     94>>> try: isValidFloat(u"ä", None)
     95... except ValidationError: pass
    9196"""}
Back to Top