-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34754 from dimagi/jc/limit-batch-size-for-entra
Limit batch size for entra api
- Loading branch information
Showing
4 changed files
with
66 additions
and
51 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
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 |
---|---|---|
|
@@ -333,8 +333,8 @@ def setUpClass(cls): | |
email_domain='vaultwax.com', | ||
identity_provider=cls.idp, | ||
) | ||
idp_patcher = patch('corehq.apps.sso.models.IdentityProvider.get_all_members_of_the_idp') | ||
cls.mock_get_all_members_of_the_idp = idp_patcher.start() | ||
idp_patcher = patch('corehq.apps.sso.models.IdentityProvider.get_all_usernames_of_the_idp') | ||
cls.mock_get_all_usernames_of_the_idp = idp_patcher.start() | ||
cls.addClassCleanup(idp_patcher.stop) | ||
|
||
def setUp(self): | ||
|
@@ -345,7 +345,7 @@ def setUp(self): | |
|
||
def test_user_is_deactivated_if_not_member_of_idp(self): | ||
self.assertTrue(self.web_user_c.is_active) | ||
self.mock_get_all_members_of_the_idp.return_value = [self.web_user_a.username, self.web_user_b.username] | ||
self.mock_get_all_usernames_of_the_idp.return_value = [self.web_user_a.username, self.web_user_b.username] | ||
|
||
auto_deactivate_removed_sso_users() | ||
|
||
|
@@ -359,7 +359,7 @@ def test_sso_exempt_users_are_not_deactivated(self): | |
username=sso_exempt.username, | ||
email_domain=self.email_domain, | ||
) | ||
self.mock_get_all_members_of_the_idp.return_value = [self.web_user_a.username, self.web_user_b.username] | ||
self.mock_get_all_usernames_of_the_idp.return_value = [self.web_user_a.username, self.web_user_b.username] | ||
|
||
auto_deactivate_removed_sso_users() | ||
|
||
|
@@ -369,7 +369,7 @@ def test_sso_exempt_users_are_not_deactivated(self): | |
|
||
@patch('corehq.apps.sso.tasks.send_html_email_async.delay') | ||
def test_deactivation_skipped_if_entra_return_empty_sso_user(self, mock_send): | ||
self.mock_get_all_members_of_the_idp.return_value = [] | ||
self.mock_get_all_usernames_of_the_idp.return_value = [] | ||
|
||
auto_deactivate_removed_sso_users() | ||
|
||
|
@@ -384,7 +384,7 @@ def test_deactivation_skipped_if_entra_return_empty_sso_user(self, mock_send): | |
|
||
def test_deactivation_skip_members_of_the_domains_but_not_have_an_email_domain_controlled_by_the_idp(self): | ||
dimagi_user = self._create_web_user('[email protected]') | ||
self.mock_get_all_members_of_the_idp.return_value = [self.web_user_a.username, self.web_user_b.username] | ||
self.mock_get_all_usernames_of_the_idp.return_value = [self.web_user_a.username, self.web_user_b.username] | ||
|
||
auto_deactivate_removed_sso_users() | ||
|
||
|
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