1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

[1.7.x] Fixed #23451 -- Fixed typo in inlineformset_factory() error message.

Backport of f7eee04ebe from master
This commit is contained in:
Petras Zdanavičius
2014-09-08 22:54:57 +03:00
committed by Tim Graham
parent 1f1a329288
commit a3e9e9e6c6
3 changed files with 10 additions and 1 deletions

View File

@@ -805,6 +805,12 @@ class ModelFormsetTest(TestCase):
formset = AuthorBooksFormSet(data, instance=author, queryset=custom_qs)
self.assertTrue(formset.is_valid())
def test_inline_formsets_with_wrong_fk_name(self):
""" Regression for #23451 """
message = "fk_name 'title' is not a ForeignKey to 'model_formsets.Author'."
with self.assertRaisesMessage(ValueError, message):
inlineformset_factory(Author, Book, fields="__all__", fk_name='title')
def test_custom_pk(self):
# We need to ensure that it is displayed