Django

Code

Changeset 5099

Show
Ignore:
Timestamp:
04/26/07 10:05:47 (1 year ago)
Author:
adrian
Message:

Fixed inconsistent period usage in localflavor.br error messages from [5089]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/localflavor/br/forms.py

    r5089 r5099  
    3232class BRStateSelect(Select): 
    3333    """ 
    34     A Select widget that uses a list of brazilian states/territories 
     34    A Select widget that uses a list of Brazilian states/territories 
    3535    as its choices. 
    3636    """ 
     
    4848    """ 
    4949    This field validate a CPF number or a CPF string. A CPF number is 
    50     compounded by XXX.XXX.XXX-VD, the two last digits are check digits. 
     50    compounded by XXX.XXX.XXX-VD. The two last digits are check digits. 
    5151 
    5252    More information: 
     
    7070            int(value) 
    7171        except ValueError: 
    72             raise ValidationError(gettext("This field requires only numbers")) 
     72            raise ValidationError(gettext("This field requires only numbers.")) 
    7373        if len(value) != 11: 
    7474            raise ValidationError(gettext("This field requires at most 11 digits or 14 characters.")) 
     
    101101            int(value) 
    102102        except ValueError: 
    103             raise ValidationError("This field requires only numbers") 
     103            raise ValidationError("This field requires only numbers.") 
    104104        if len(value) != 14: 
    105105            raise ValidationError( 
     
    114114        value = value[:-1] + str(new_2dv) 
    115115        if value[-2:] != orig_dv: 
    116             raise ValidationError(gettext("Invalid CNPJ number")) 
     116            raise ValidationError(gettext("Invalid CNPJ number.")) 
    117117 
    118118        return orig_value 
  • django/trunk/tests/regressiontests/forms/localflavor.py

    r5089 r5099  
    852852Traceback (most recent call last): 
    853853... 
    854 ValidationError: [u'Invalid CNPJ number'] 
     854ValidationError: [u'Invalid CNPJ number.'] 
    855855>>> f.clean('12.345.678/9012-10') 
    856856Traceback (most recent call last): 
    857857... 
    858 ValidationError: [u'Invalid CNPJ number'] 
     858ValidationError: [u'Invalid CNPJ number.'] 
    859859>>> f.clean('12345678/9012-10') 
    860860Traceback (most recent call last): 
    861861... 
    862 ValidationError: [u'Invalid CNPJ number'] 
     862ValidationError: [u'Invalid CNPJ number.'] 
    863863>>> f.clean('64.132.916/0001-88') 
    864864'64.132.916/0001-88' 
     
    870870Traceback (most recent call last): 
    871871... 
    872 ValidationError: [u'This field requires only numbers'] 
     872ValidationError: [u'This field requires only numbers.'] 
    873873>>> f = BRCNPJField(required=False) 
    874874>>> f.clean('')