diff options
| author | Petras Zdanavičius <petraszd@gmail.com> | 2014-09-08 22:54:57 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-09-08 17:22:49 -0400 |
| commit | a3e9e9e6c6dc9ccff85c2a6d8db88cc207127f0c (patch) | |
| tree | 0a2e7122f18f26498874919d93b27f6d010b8856 /tests | |
| parent | 1f1a32928873a4e7cfe2f8f15631aa63df335490 (diff) | |
[1.7.x] Fixed #23451 -- Fixed typo in inlineformset_factory() error message.
Backport of f7eee04ebe from master
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/model_formsets/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/model_formsets/tests.py b/tests/model_formsets/tests.py index 07f5ccf18b..e814a2950b 100644 --- a/tests/model_formsets/tests.py +++ b/tests/model_formsets/tests.py @@ -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 |
