Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
amCap1712 committed Dec 4, 2024
1 parent 9e66a4a commit cb81b61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions critiquebrainz/frontend/views/test/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ def test_login_oauth(self, mock_requests):
""" Tests that creating a new user, update MB username and login to CB updates MB username in CB db """
row_id = 1111

mock_requests.post("https://musicbrainz.org/oauth2/token", json={
mock_requests.post("https://musicbrainz.org/new-oauth2/token", json={
"access_token": "UF7GvG2pl70jTogIwOhD32BhI_aIevPF",
"expires_in": 3600,
"token_type": "Bearer",
"refresh_token": "GjSCBBjp4fnbE0AKo3uFu9qq9K2fFm4u"
})

mock_requests.get("https://musicbrainz.org/oauth2/userinfo", json={
mock_requests.get("https://musicbrainz.org/new-oauth2/userinfo", json={
"sub": "old-user-name",
"metabrainz_user_id": row_id
})
Expand All @@ -46,7 +46,7 @@ def test_login_oauth(self, mock_requests):
self.client.get(url_for("login.logout"))

# change MB username without changing display name, musicbrainz id in database should update
mock_requests.get("https://musicbrainz.org/oauth2/userinfo", json={
mock_requests.get("https://musicbrainz.org/new-oauth2/userinfo", json={
"sub": "new-user-name",
"metabrainz_user_id": row_id
})
Expand All @@ -68,7 +68,7 @@ def test_login_oauth(self, mock_requests):
db_users.update(user["id"], {"display_name": "custom-display-name"})

# change MB username, musicbrainz id in database should not update because display name is different
mock_requests.get("https://musicbrainz.org/oauth2/userinfo", json={
mock_requests.get("https://musicbrainz.org/new-oauth2/userinfo", json={
"sub": "another-new-user-name",
"metabrainz_user_id": row_id
})
Expand Down
2 changes: 1 addition & 1 deletion custom_config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SECRET_KEY = "CHANGE_THIS"
#MUSICBRAINZ_USERAGENT = "CritiqueBrainz Custom"
MUSICBRAINZ_CLIENT_ID = ""
MUSICBRAINZ_CLIENT_SECRET = ""
MUSICBRAINZ_OAUTH_URL = ""
MUSICBRAINZ_OAUTH_URL = "https://musicbrainz.org/new-oauth2"

# Server with Spotify mappings
# https://github.com/metabrainz/mbspotify
Expand Down

0 comments on commit cb81b61

Please sign in to comment.