From 98e1cc92f47cbda977a923b9ba8d980bc01cd749 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Tue, 2 Sep 2008 14:20:11 +0000 Subject: Fixed #8795: unique_together validation no longer fails on model forms that exclude fields included in the check. Thanks, Alex Gaynor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8854 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/model_forms/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/modeltests/model_forms') diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py index dd6e25f716..e3821de758 100644 --- a/tests/modeltests/model_forms/models.py +++ b/tests/modeltests/model_forms/models.py @@ -1192,6 +1192,14 @@ False >>> form._errors {'__all__': [u'Price with this Price and Quantity already exists.']} +>>> class PriceForm(ModelForm): +... class Meta: +... model = Price +... exclude = ('quantity',) +>>> form = PriceForm({'price': '6.00'}) +>>> form.is_valid() +True + # Choices on CharField and IntegerField >>> class ArticleForm(ModelForm): ... class Meta: -- cgit v1.3