~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to tests/regressiontests/forms/error_messages.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2010-05-21 07:52:55 UTC
  • mfrom: (1.3.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20100521075255-ii78v1dyfmyu3uzx
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
# CharField ###################################################################
7
7
 
8
8
>>> e = {'required': 'REQUIRED'}
9
 
>>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s'
10
 
>>> e['max_length'] = 'LENGTH %(length)s, MAX LENGTH %(max)s'
 
9
>>> e['min_length'] = 'LENGTH %(show_value)s, MIN LENGTH %(limit_value)s'
 
10
>>> e['max_length'] = 'LENGTH %(show_value)s, MAX LENGTH %(limit_value)s'
11
11
>>> f = CharField(min_length=5, max_length=10, error_messages=e)
12
12
>>> f.clean('')
13
13
Traceback (most recent call last):
26
26
 
27
27
>>> e = {'required': 'REQUIRED'}
28
28
>>> e['invalid'] = 'INVALID'
29
 
>>> e['min_value'] = 'MIN VALUE IS %s'
30
 
>>> e['max_value'] = 'MAX VALUE IS %s'
 
29
>>> e['min_value'] = 'MIN VALUE IS %(limit_value)s'
 
30
>>> e['max_value'] = 'MAX VALUE IS %(limit_value)s'
31
31
>>> f = IntegerField(min_value=5, max_value=10, error_messages=e)
32
32
>>> f.clean('')
33
33
Traceback (most recent call last):
50
50
 
51
51
>>> e = {'required': 'REQUIRED'}
52
52
>>> e['invalid'] = 'INVALID'
53
 
>>> e['min_value'] = 'MIN VALUE IS %s'
54
 
>>> e['max_value'] = 'MAX VALUE IS %s'
 
53
>>> e['min_value'] = 'MIN VALUE IS %(limit_value)s'
 
54
>>> e['max_value'] = 'MAX VALUE IS %(limit_value)s'
55
55
>>> f = FloatField(min_value=5, max_value=10, error_messages=e)
56
56
>>> f.clean('')
57
57
Traceback (most recent call last):
74
74
 
75
75
>>> e = {'required': 'REQUIRED'}
76
76
>>> e['invalid'] = 'INVALID'
77
 
>>> e['min_value'] = 'MIN VALUE IS %s'
78
 
>>> e['max_value'] = 'MAX VALUE IS %s'
 
77
>>> e['min_value'] = 'MIN VALUE IS %(limit_value)s'
 
78
>>> e['max_value'] = 'MAX VALUE IS %(limit_value)s'
79
79
>>> e['max_digits'] = 'MAX DIGITS IS %s'
80
80
>>> e['max_decimal_places'] = 'MAX DP IS %s'
81
81
>>> e['max_whole_digits'] = 'MAX DIGITS BEFORE DP IS %s'
156
156
 
157
157
>>> e = {'required': 'REQUIRED'}
158
158
>>> e['invalid'] = 'INVALID'
159
 
>>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s'
160
 
>>> e['max_length'] = 'LENGTH %(length)s, MAX LENGTH %(max)s'
 
159
>>> e['min_length'] = 'LENGTH %(show_value)s, MIN LENGTH %(limit_value)s'
 
160
>>> e['max_length'] = 'LENGTH %(show_value)s, MAX LENGTH %(limit_value)s'
161
161
>>> f = RegexField(r'^\d+$', min_length=5, max_length=10, error_messages=e)
162
162
>>> f.clean('')
163
163
Traceback (most recent call last):
180
180
 
181
181
>>> e = {'required': 'REQUIRED'}
182
182
>>> e['invalid'] = 'INVALID'
183
 
>>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s'
184
 
>>> e['max_length'] = 'LENGTH %(length)s, MAX LENGTH %(max)s'
 
183
>>> e['min_length'] = 'LENGTH %(show_value)s, MIN LENGTH %(limit_value)s'
 
184
>>> e['max_length'] = 'LENGTH %(show_value)s, MAX LENGTH %(limit_value)s'
185
185
>>> f = EmailField(min_length=8, max_length=10, error_messages=e)
186
186
>>> f.clean('')
187
187
Traceback (most recent call last):