django-oauth/django-oauth-toolkit

py{310,311,312}-djmain tests.test_commands.CreateApplicationTest failing

Closed this issue · 0 comments

n2ygk commented

Describe the bug

djmain has changed the wording of a user not found error message, causing the test for a failed validation to fail:

______________________________________________ CreateApplicationTest.test_validation_failed_message _______________________________________________

self = <tests.test_commands.CreateApplicationTest testMethod=test_validation_failed_message>

    def test_validation_failed_message(self):
        output = StringIO()
        call_command(
            "createapplication",
            "confidential",
            "authorization-code",
            "--redirect-uris=http://example.com http://example2.com",
            "--user=783",
            stdout=output,
        )
    
        self.assertIn("user", output.getvalue())
        self.assertIn("783", output.getvalue())
>       self.assertIn("does not exist", output.getvalue())
E       AssertionError: 'does not exist' not found in "\x1b[31;1mPlease correct the following errors:\n - user: ['user instance with id 783 is not a valid choice.']\x1b[0m\n"

tests/test_commands.py:145: AssertionError

To Reproduce

tox -e py310-djmain

Expected behavior

All tests should have passed

Version

  • I have tested with the latest published release and it's still a problem.
  • I have tested with the master branch and it's still a problem.

Additional context