-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
194 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
backend/benefit/applications/management/commands/get_signer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from applications.enums import AhjoRequestType | ||
from applications.management.commands.ahjo_base_command import AhjoRequestBaseClass | ||
|
||
|
||
class Command(AhjoRequestBaseClass): | ||
help = ( | ||
"Get the decision maker from Ahjo and store it in the database in Ahjo settings" | ||
) | ||
request_type = AhjoRequestType.GET_SIGNER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
backend/benefit/applications/tests/test_ahjo_request_handler.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
|
||
from applications.enums import AhjoRequestType | ||
from applications.services.ahjo.request_handler import AhjoRequestHandler | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"request_type", | ||
[ | ||
(AhjoRequestType.GET_DECISION_MAKER), | ||
(AhjoRequestType.GET_SIGNER), | ||
], | ||
) | ||
def test_init_sets_token_and_request_type(request_type, non_expired_token): | ||
""" | ||
Test that the constructor correctly sets token and request type | ||
""" | ||
request_handler = AhjoRequestHandler(non_expired_token, request_type) | ||
|
||
assert request_handler.ahjo_token == non_expired_token | ||
assert request_handler.ahjo_request_type == request_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters