diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-09-02 14:20:11 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-09-02 14:20:11 +0000 |
| commit | 98e1cc92f47cbda977a923b9ba8d980bc01cd749 (patch) | |
| tree | a3e779853a15cb1d987d4c39082a8cbdb3ae49c1 /tests | |
| parent | 5c32fe7fad5c52fb5b62dc97503aed516bb9c668 (diff) | |
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
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/model_forms/models.py | 8 |
1 files changed, 8 insertions, 0 deletions
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: |
