From f7eee04ebe32277d2f3d7860abfb9a22c6ccf19d Mon Sep 17 00:00:00 2001 From: Petras Zdanavičius Date: Mon, 8 Sep 2014 22:54:57 +0300 Subject: Fixed #23451 -- Fixed typo in inlineformset_factory() error message. --- tests/model_formsets/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/model_formsets') diff --git a/tests/model_formsets/tests.py b/tests/model_formsets/tests.py index 19c0a6d9d5..58d8bcc9ab 100644 --- a/tests/model_formsets/tests.py +++ b/tests/model_formsets/tests.py @@ -815,6 +815,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 -- cgit v1.3