We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72d0551 commit 2befdb1Copy full SHA for 2befdb1
tests/test_commands.py
@@ -140,6 +140,11 @@ def test_validation_failed_message(self):
140
stdout=output,
141
)
142
143
- self.assertIn("user", output.getvalue())
144
- self.assertIn("783", output.getvalue())
145
- self.assertIn("does not exist", output.getvalue())
+ output_str = output.getvalue()
+ self.assertIn("user", output_str)
+ self.assertIn("783", output_str)
146
+ # newer Django (>5.1) changes the error message from "does not exist" to "is not a valid choice"
147
+ self.assertTrue(
148
+ any(substring in output_str for substring in ["does not exist", "is not a valid choice"]),
149
+ f"Output did not contain 'does not exist' or 'is not a valid choice'. Actual output: {output_str}",
150
+ )
0 commit comments