Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a couple form/formset deprecation warnings in tests.

  • Loading branch information...
commit a521d103227be4e5660cf7a66bf98003696aa781 1 parent a6a905c
@timgraham timgraham authored
Showing with 3 additions and 1 deletion.
  1. +2 −0  tests/model_forms/tests.py
  2. +1 −1  tests/model_formsets/tests.py
View
2  tests/model_forms/tests.py
@@ -252,10 +252,12 @@ class Meta:
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
View
2  tests/model_formsets/tests.py
@@ -399,7 +399,7 @@ def __init__(self, *args, **kwargs):
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)
Please sign in to comment.
Something went wrong with that request. Please try again.