Skip to content

Commit

Permalink
Correct test_invalid_login to expect InvalidGrantError.
Browse files Browse the repository at this point in the history
  • Loading branch information
paul121 committed Dec 14, 2021
1 parent 1985b84 commit 29e6e5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Do not include the endpoint property in the serialized subrequest.
- Update client_2x Subrequests docs to include a plant_type when creating the plant asset.
- Correct test_invalid_login to expect InvalidGrantError: https://www.drupal.org/project/simple_oauth/issues/3193609

## [1.0.0-beta.3] -- 2021-07-26
### Fixed
Expand Down
7 changes: 2 additions & 5 deletions tests/functional/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import time

import pytest
from oauthlib.oauth2 import InvalidClientError, InvalidScopeError
from oauthlib.oauth2.rfc6749.errors import CustomOAuth2Error
from oauthlib.oauth2 import InvalidClientError, InvalidGrantError, InvalidScopeError
from requests import HTTPError

from farmOS import farmOS
Expand All @@ -17,9 +16,7 @@

@farmOS_testing_server
def test_invalid_login():
# todo: simple_oauth returns invalid_credentials instead of invalid_grant.
# https://www.drupal.org/project/simple_oauth/issues/3193609
with pytest.raises(CustomOAuth2Error, match=r"invalid_credentials *."):
with pytest.raises(InvalidGrantError):
farm = farmOS(hostname=FARMOS_HOSTNAME, scope="farm_manager", version=2)
farm.authorize("username", "password")

Expand Down

0 comments on commit 29e6e5d

Please # to comment.