From 963ccd7cb4c923a70dfcf4b321fa74a099c69948 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 10 Jan 2007 23:34:37 +0000 Subject: Fixed #3267 -- newforms: Changed database TextField to render as Textarea in form_for_model() forms. Thanks for the patch, Philipp Keller git-svn-id: http://code.djangoproject.com/svn/django/trunk@4305 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/model_forms/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py index e2335c9f3e..620565721c 100644 --- a/tests/modeltests/model_forms/models.py +++ b/tests/modeltests/model_forms/models.py @@ -41,6 +41,7 @@ class Article(models.Model): headline = models.CharField(maxlength=50) pub_date = models.DateField() writer = models.ForeignKey(Writer) + article = models.TextField() categories = models.ManyToManyField(Category, blank=True) def __str__(self): @@ -144,6 +145,7 @@ represented by a ChoiceField. +Article: Categories: ->>> art = Article(headline='Test article', pub_date=datetime.date(1988, 1, 4), writer=w) +>>> art = Article(headline='Test article', pub_date=datetime.date(1988, 1, 4), writer=w, article='Hello.') >>> art.save() >>> art.id 1 @@ -183,12 +185,13 @@ current values are inserted as 'initial' data in each Field. +
  • Article:
  • Categories:
  • ->>> f = TestArticleForm({'headline': u'New headline', 'pub_date': u'1988-01-04', 'writer': u'1'}) +>>> f = TestArticleForm({'headline': u'New headline', 'pub_date': u'1988-01-04', 'writer': u'1', 'article': 'Hello.'}) >>> f.is_valid() True >>> new_art = f.save() @@ -214,6 +217,7 @@ Add some categories and test the many-to-many form output. +
  • Article:
  • Categories: