-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENT-8079 - Make dsc optional based on enterprise config
- Loading branch information
1 parent
25bed3a
commit 81d90df
Showing
2 changed files
with
44 additions
and
6 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
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 |
---|---|---|
|
@@ -198,7 +198,8 @@ def test_create_allocation_payload(self, mock_get_enterprise_customer_data, mock | |
else: | ||
assert geag_payload.get(geag_field) == tx_metadata.get(payload_field) | ||
|
||
def test_validate_pass(self): | ||
@mock.patch("enterprise_subsidy.apps.api_client.enterprise.EnterpriseApiClient.get_enterprise_customer_data") | ||
def test_validate_pass(self, mock_get_enterprise_customer_data): | ||
""" | ||
Ensure `_validate` method passes | ||
""" | ||
|
@@ -208,7 +209,10 @@ def test_validate_pass(self): | |
'geag_email': '[email protected]', | ||
'geag_date_of_birth': '1900-01-01', | ||
'geag_terms_accepted_at': '2021-05-21T17:32:28Z', | ||
'geag_data_share_consent': True, | ||
} | ||
mock_get_enterprise_customer_data.return_value = { | ||
'auth_org_id': 'asde23eas', | ||
'enable_data_sharing_consent': False, | ||
} | ||
transaction = TransactionFactory.create( | ||
state=TransactionStateChoices.PENDING, | ||
|
@@ -221,7 +225,8 @@ def test_validate_pass(self): | |
# pylint: disable=protected-access | ||
assert self.geag_fulfillment_handler._validate(transaction) | ||
|
||
def test_validate_fail(self): | ||
@mock.patch("enterprise_subsidy.apps.api_client.enterprise.EnterpriseApiClient.get_enterprise_customer_data") | ||
def test_validate_fail(self, mock_get_enterprise_customer_data): | ||
""" | ||
Ensure `_validate` method raises with a missing `geag_terms_accepted_at` | ||
""" | ||
|
@@ -233,6 +238,10 @@ def test_validate_fail(self): | |
'geag_terms_accepted_at': '2021-05-21T17:32:28Z', | ||
'geag_data_share_consent': True, | ||
} | ||
mock_get_enterprise_customer_data.return_value = { | ||
'auth_org_id': 'asde23eas', | ||
'enable_data_sharing_consent': True | ||
} | ||
transaction = TransactionFactory.create( | ||
state=TransactionStateChoices.PENDING, | ||
quantity=-19998, | ||
|