diff options
| author | Tim Graham <timograham@gmail.com> | 2013-07-01 09:36:31 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-07-01 09:38:29 -0400 |
| commit | 4c1029971e810cde32ee4cd489627239b9b1b6ed (patch) | |
| tree | bb6db847217e8c20981cb381b079806c0e9b3b11 | |
| parent | 3c51962cabc9537221b86c667aac5ffaa1469660 (diff) | |
[1.6.x] Fixed a couple form/formset deprecation warnings in tests.
Backport of a521d10322 from master.
| -rw-r--r-- | tests/model_forms/tests.py | 2 | ||||
| -rw-r--r-- | tests/model_formsets/tests.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py index 39be824798..19f0216ec7 100644 --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -252,10 +252,12 @@ class StatusNoteCBM2mForm(forms.ModelForm): fields = '__all__' widgets = {'status': forms.CheckboxSelectMultiple} + class CustomErrorMessageForm(forms.ModelForm): name1 = forms.CharField(error_messages={'invalid': 'Form custom error message.'}) class Meta: + fields = '__all__' model = CustomErrorMessage diff --git a/tests/model_formsets/tests.py b/tests/model_formsets/tests.py index 43509c471f..09a3ba1778 100644 --- a/tests/model_formsets/tests.py +++ b/tests/model_formsets/tests.py @@ -399,7 +399,7 @@ class ModelFormsetTest(TestCase): super(BaseAuthorFormSet, self).__init__(*args, **kwargs) self.queryset = Author.objects.filter(name__startswith='Charles') - AuthorFormSet = modelformset_factory(Author, formset=BaseAuthorFormSet) + AuthorFormSet = modelformset_factory(Author, fields='__all__', formset=BaseAuthorFormSet) formset = AuthorFormSet() self.assertEqual(len(formset.get_queryset()), 1) |
