Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1722.
@tienne-B can you think of any cleaner ways to do this?
Also, I wanted to add a simple regression test just to check the label of the field, so that if a package change bites us like this again, we'll know straight away rather than only when it's reported by a user. But I couldn't find any off-the-shelf tests suitable for checking the label of a field, and it's complicated by how the formset and form in question aren't classes in their own right; they're constructed by factories in the view. We could check the HTML output directly, but that's messy, and the
value
attribute of the<option>
element is database-dependent (since it's the ID of the content type). I guess this is mostly a frontend function (the labels aren't, but the dropdown filtering is), so it's not really cut out for testing by the Django testing tools. The other idea would be to include a unit test for the JavaScript in venues/templates/venue_constraints_edit.html, @philipbelesky is there any (easy) scope for this?(If adding a test is too hard then we should just merge without it, I just wanted to get takes on the idea first, since this seems like the kind of thing regression testing is for.)