mirror of https://github.com/django/django.git
Fixed a couple form/formset deprecation warnings in tests.
This commit is contained in:
parent
a6a905c619
commit
a521d10322
|
@ -252,10 +252,12 @@ class StatusNoteCBM2mForm(forms.ModelForm):
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
widgets = {'status': forms.CheckboxSelectMultiple}
|
widgets = {'status': forms.CheckboxSelectMultiple}
|
||||||
|
|
||||||
|
|
||||||
class CustomErrorMessageForm(forms.ModelForm):
|
class CustomErrorMessageForm(forms.ModelForm):
|
||||||
name1 = forms.CharField(error_messages={'invalid': 'Form custom error message.'})
|
name1 = forms.CharField(error_messages={'invalid': 'Form custom error message.'})
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
fields = '__all__'
|
||||||
model = CustomErrorMessage
|
model = CustomErrorMessage
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -399,7 +399,7 @@ class ModelFormsetTest(TestCase):
|
||||||
super(BaseAuthorFormSet, self).__init__(*args, **kwargs)
|
super(BaseAuthorFormSet, self).__init__(*args, **kwargs)
|
||||||
self.queryset = Author.objects.filter(name__startswith='Charles')
|
self.queryset = Author.objects.filter(name__startswith='Charles')
|
||||||
|
|
||||||
AuthorFormSet = modelformset_factory(Author, formset=BaseAuthorFormSet)
|
AuthorFormSet = modelformset_factory(Author, fields='__all__', formset=BaseAuthorFormSet)
|
||||||
formset = AuthorFormSet()
|
formset = AuthorFormSet()
|
||||||
self.assertEqual(len(formset.get_queryset()), 1)
|
self.assertEqual(len(formset.get_queryset()), 1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue