Ticket #9171: 9171-inlineformset_factory-r9082.diff

File 9171-inlineformset_factory-r9082.diff, 876 bytes (added by mrmachine, 6 years ago)

Added regression test that fails before and passes after patch is applied.

  • django/forms/models.py

     
    528528    if fk.unique:
    529529        max_num = 1
    530530    if exclude is not None:
     531        exclude = list(exclude)
    531532        exclude.append(fk.name)
    532533    else:
    533534        exclude = [fk.name]
  • tests/regressiontests/inline_formsets/models.py

     
    5151Exception: <class 'regressiontests.inline_formsets.models.Child'> has no field named 'test'
    5252
    5353
     54# Regression test for #9171.
     55>>> ifs = inlineformset_factory(Parent, Child, exclude=('school',), fk_name='mother')
    5456"""
    5557}
Back to Top