Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test for changed error message from newer Django (djmain) #1486

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def test_application_created_with_algorithm(self):
self.assertEqual(app.algorithm, "RS256")

def test_validation_failed_message(self):
import django

output = StringIO()
call_command(
"createapplication",
Expand All @@ -140,6 +142,10 @@ def test_validation_failed_message(self):
stdout=output,
)

self.assertIn("user", output.getvalue())
self.assertIn("783", output.getvalue())
self.assertIn("does not exist", output.getvalue())
output_str = output.getvalue()
self.assertIn("user", output_str)
self.assertIn("783", output_str)
if django.VERSION < (5, 2):
self.assertIn("does not exist", output_str)
else:
self.assertIn("is not a valid choice", output_str)
Loading