diff options
| author | Claude Paroz <claude@2xlibre.net> | 2013-06-22 09:25:14 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2013-06-22 09:29:37 +0200 |
| commit | ef79582e8630cb3c119caed52130c9671188addd (patch) | |
| tree | d2047e8ce077c7dfcb36f8404b9abb1fa9cc1ae0 /tests/forms_tests | |
| parent | 9be93aa809c34083ebef8392e52c83df0e383be3 (diff) | |
Fixed 17478 -- Allowed queryset overriding in BaseModelFormSet init
BaseModelFormSet.forms is now a cached property instead of being
populated in the __init__ method. This behaviour also matches an
example in the documentation.
Thanks Thomasz Swiderski for the report and Simon Charette for the
review.
Diffstat (limited to 'tests/forms_tests')
| -rw-r--r-- | tests/forms_tests/tests/test_formsets.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/forms_tests/tests/test_formsets.py b/tests/forms_tests/tests/test_formsets.py index b26017bc78..41577e6049 100644 --- a/tests/forms_tests/tests/test_formsets.py +++ b/tests/forms_tests/tests/test_formsets.py @@ -1072,7 +1072,8 @@ ArticleFormSet = formset_factory(ArticleForm) class TestIsBoundBehavior(TestCase): def test_no_data_raises_validation_error(self): - self.assertRaises(ValidationError, ArticleFormSet, {}) + with self.assertRaises(ValidationError): + ArticleFormSet({}).is_valid() def test_with_management_data_attrs_work_fine(self): data = { |
