def test_infoform_set_submission_type_2nd_event(event, other_event, submission_type): # https://github.com/pretalx/pretalx/issues/642 f = InfoForm(event) assert len(SubmissionType.objects.all()) > 1 assert len(event.submission_types.all()) == 2 assert len(f.fields['submission_type'].queryset) == 2 assert not isinstance(f.fields['submission_type'].widget, forms.HiddenInput)
def test_infoform_set_submission_type(event, other_event): # https://github.com/pretalx/pretalx/issues/642 with scopes_disabled(): assert len(SubmissionType.objects.all()) > 1 with scope(event=event): f = InfoForm(event) assert len(event.submission_types.all()) == 1 assert len(f.fields['submission_type'].queryset) == 1 assert f.fields['submission_type'].initial == event.submission_types.all()[0] assert isinstance(f.fields['submission_type'].widget, forms.HiddenInput)