Skip to content

Remove unneeded oauth config #406

Remove unneeded oauth config

Remove unneeded oauth config #406

GitHub Actions / Test Results failed Dec 11, 2024 in 0s

2 fail, 5 skipped, 172 pass in 25s

179 tests   172 ✅  25s ⏱️
  1 suites    5 💤
  1 files      2 ❌

Results for commit 8c7b8e1.

Annotations

Check warning on line 0 in oauth.tests.test_oauth_authorization_code.AuthorizationCodeGrantTestCase

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_oauth_authorize_logged_out (oauth.tests.test_oauth_authorization_code.AuthorizationCodeGrantTestCase) failed

reports/tests.xml [took 0s]
Raw output
AssertionError: 'http://localhost/oauth2/authorize?client_id=pMJr[115 chars]back' != 'http://None/oauth2/authorize?client_id=pMJrWHsky[110 chars]back'
- http://localhost/oauth2/authorize?client_id=pMJrWHskya1mwYLnOh0mGpKP&response_type=code&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback
?        ^ ^^^^^^^
+ http://None/oauth2/authorize?client_id=pMJrWHskya1mwYLnOh0mGpKP&response_type=code&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback
?        ^ ^^
self = <oauth.tests.test_oauth_authorization_code.AuthorizationCodeGrantTestCase testMethod=test_oauth_authorize_logged_out>

    def test_oauth_authorize_logged_out(self):
        application = self.create_oauth_app()
        response = self.client.get(
            "/oauth2/authorize",
            query_string={
                "client_id": application["client_id"],
                "response_type": "code",
                "scope": "test-scope-1",
                "state": "random-state",
                "redirect_uri": "https://example.com/callback",
            }
        )
        self.assertEqual(response.status_code, 302)
        parsed = urlparse(response.location)
        self.assertEqual(parsed.scheme, "https")
        self.assertEqual(parsed.scheme + "://" + parsed.netloc, self.app.config["MUSICBRAINZ_SERVER"])
        self.assertEqual(parsed.path, "/login")
    
        fragment_args = parse_qs(parsed.query)
>       self.assertEqual(unquote(fragment_args["returnto"][0]), f"http://{self.app.config['SERVER_NAME']}/oauth2/authorize?client_id={application['client_id']}&response_type=code&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback")
E       AssertionError: 'http://localhost/oauth2/authorize?client_id=pMJr[115 chars]back' != 'http://None/oauth2/authorize?client_id=pMJrWHsky[110 chars]back'
E       - http://localhost/oauth2/authorize?client_id=pMJrWHskya1mwYLnOh0mGpKP&response_type=code&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback
E       ?        ^ ^^^^^^^
E       + http://None/oauth2/authorize?client_id=pMJrWHskya1mwYLnOh0mGpKP&response_type=code&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback
E       ?        ^ ^^

oauth/tests/test_oauth_authorization_code.py:465: AssertionError

Check warning on line 0 in oauth.tests.test_oauth_implicit.ImplicitGrantTestCase

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_oauth_authorize_logged_out (oauth.tests.test_oauth_implicit.ImplicitGrantTestCase) failed

reports/tests.xml [took 0s]
Raw output
AssertionError: 'http://localhost/oauth2/authorize?client_id=FQVH[116 chars]back' != 'http://None/oauth2/authorize?client_id=FQVHELv1C[111 chars]back'
- http://localhost/oauth2/authorize?client_id=FQVHELv1Ch3zMEGTuHnzl6H0&response_type=token&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback
?        ^ ^^^^^^^
+ http://None/oauth2/authorize?client_id=FQVHELv1Ch3zMEGTuHnzl6H0&response_type=token&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback
?        ^ ^^
self = <oauth.tests.test_oauth_implicit.ImplicitGrantTestCase testMethod=test_oauth_authorize_logged_out>

    def test_oauth_authorize_logged_out(self):
        application = self.create_oauth_app()
        response = self.client.get(
            "/oauth2/authorize",
            query_string={
                "client_id": application["client_id"],
                "response_type": "token",
                "scope": "test-scope-1",
                "state": "random-state",
                "redirect_uri": "https://example.com/callback",
            }
        )
        self.assertEqual(response.status_code, 302)
        parsed = urlparse(response.location)
        self.assertEqual(parsed.scheme, "https")
        self.assertEqual(parsed.scheme + "://" + parsed.netloc, self.app.config["MUSICBRAINZ_SERVER"])
        self.assertEqual(parsed.path, "/login")
    
        fragment_args = parse_qs(parsed.query)
>       self.assertEqual(unquote(fragment_args["returnto"][0]), f"http://{self.app.config['SERVER_NAME']}/oauth2/authorize?client_id={application['client_id']}&response_type=token&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback")
E       AssertionError: 'http://localhost/oauth2/authorize?client_id=FQVH[116 chars]back' != 'http://None/oauth2/authorize?client_id=FQVHELv1C[111 chars]back'
E       - http://localhost/oauth2/authorize?client_id=FQVHELv1Ch3zMEGTuHnzl6H0&response_type=token&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback
E       ?        ^ ^^^^^^^
E       + http://None/oauth2/authorize?client_id=FQVHELv1Ch3zMEGTuHnzl6H0&response_type=token&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback
E       ?        ^ ^^

oauth/tests/test_oauth_implicit.py:183: AssertionError