Fixed a couple of typos.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17166 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
f51205d0ed
commit
5e2f5d1466
|
@ -119,7 +119,7 @@ class BaseCommand(object):
|
||||||
option_list = (
|
option_list = (
|
||||||
make_option('-v', '--verbosity', action='store', dest='verbosity', default='1',
|
make_option('-v', '--verbosity', action='store', dest='verbosity', default='1',
|
||||||
type='choice', choices=['0', '1', '2', '3'],
|
type='choice', choices=['0', '1', '2', '3'],
|
||||||
help='Verbosity level; 0=minimal output, 1=normal output, 2=verbose output 3=very verbose output'),
|
help='Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output'),
|
||||||
make_option('--settings',
|
make_option('--settings',
|
||||||
help='The Python path to a settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.'),
|
help='The Python path to a settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.'),
|
||||||
make_option('--pythonpath',
|
make_option('--pythonpath',
|
||||||
|
|
|
@ -18,7 +18,7 @@ class SelectDateForm(forms.Form):
|
||||||
date_field = forms.DateField(widget=SelectDateWidget)
|
date_field = forms.DateField(widget=SelectDateWidget)
|
||||||
|
|
||||||
class CompanyForm(forms.ModelForm):
|
class CompanyForm(forms.ModelForm):
|
||||||
cents_payed = forms.DecimalField(max_digits=4, decimal_places=2, localize=True)
|
cents_paid = forms.DecimalField(max_digits=4, decimal_places=2, localize=True)
|
||||||
products_delivered = forms.IntegerField(localize=True)
|
products_delivered = forms.IntegerField(localize=True)
|
||||||
date_added = forms.DateTimeField(localize=True)
|
date_added = forms.DateTimeField(localize=True)
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ class TestModel(models.Model):
|
||||||
class Company(models.Model):
|
class Company(models.Model):
|
||||||
name = models.CharField(max_length=50)
|
name = models.CharField(max_length=50)
|
||||||
date_added = models.DateTimeField(default=datetime(1799,1,31,23,59,59,0))
|
date_added = models.DateTimeField(default=datetime(1799,1,31,23,59,59,0))
|
||||||
cents_payed = models.DecimalField(max_digits=4, decimal_places=2)
|
cents_paid = models.DecimalField(max_digits=4, decimal_places=2)
|
||||||
products_delivered = models.IntegerField()
|
products_delivered = models.IntegerField()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -610,13 +610,13 @@ class FormattingTests(TestCase):
|
||||||
form6 = CompanyForm({
|
form6 = CompanyForm({
|
||||||
'name': u'acme',
|
'name': u'acme',
|
||||||
'date_added': datetime.datetime(2009, 12, 31, 6, 0, 0),
|
'date_added': datetime.datetime(2009, 12, 31, 6, 0, 0),
|
||||||
'cents_payed': decimal.Decimal('59.47'),
|
'cents_paid': decimal.Decimal('59.47'),
|
||||||
'products_delivered': 12000,
|
'products_delivered': 12000,
|
||||||
})
|
})
|
||||||
self.assertEqual(True, form6.is_valid())
|
self.assertEqual(True, form6.is_valid())
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
form6.as_ul(),
|
form6.as_ul(),
|
||||||
u'<li><label for="id_name">Name:</label> <input id="id_name" type="text" name="name" value="acme" maxlength="50" /></li>\n<li><label for="id_date_added">Date added:</label> <input type="text" name="date_added" value="31.12.2009 06:00:00" id="id_date_added" /></li>\n<li><label for="id_cents_payed">Cents payed:</label> <input type="text" name="cents_payed" value="59,47" id="id_cents_payed" /></li>\n<li><label for="id_products_delivered">Products delivered:</label> <input type="text" name="products_delivered" value="12000" id="id_products_delivered" /></li>'
|
u'<li><label for="id_name">Name:</label> <input id="id_name" type="text" name="name" value="acme" maxlength="50" /></li>\n<li><label for="id_date_added">Date added:</label> <input type="text" name="date_added" value="31.12.2009 06:00:00" id="id_date_added" /></li>\n<li><label for="id_cents_paid">Cents paid:</label> <input type="text" name="cents_paid" value="59,47" id="id_cents_paid" /></li>\n<li><label for="id_products_delivered">Products delivered:</label> <input type="text" name="products_delivered" value="12000" id="id_products_delivered" /></li>'
|
||||||
)
|
)
|
||||||
self.assertEqual(localize_input(datetime.datetime(2009, 12, 31, 6, 0, 0)), '31.12.2009 06:00:00')
|
self.assertEqual(localize_input(datetime.datetime(2009, 12, 31, 6, 0, 0)), '31.12.2009 06:00:00')
|
||||||
self.assertEqual(datetime.datetime(2009, 12, 31, 6, 0, 0), form6.cleaned_data['date_added'])
|
self.assertEqual(datetime.datetime(2009, 12, 31, 6, 0, 0), form6.cleaned_data['date_added'])
|
||||||
|
@ -889,7 +889,7 @@ class TestModels(TestCase):
|
||||||
tm.save()
|
tm.save()
|
||||||
|
|
||||||
def test_safestr(self):
|
def test_safestr(self):
|
||||||
c = Company(cents_payed=12, products_delivered=1)
|
c = Company(cents_paid=12, products_delivered=1)
|
||||||
c.name = SafeUnicode(u'Iñtërnâtiônàlizætiøn1')
|
c.name = SafeUnicode(u'Iñtërnâtiônàlizætiøn1')
|
||||||
c.save()
|
c.save()
|
||||||
c.name = SafeString(u'Iñtërnâtiônàlizætiøn1'.encode('utf-8'))
|
c.name = SafeString(u'Iñtërnâtiônàlizætiøn1'.encode('utf-8'))
|
||||||
|
|
Loading…
Reference in New Issue