-
Notifications
You must be signed in to change notification settings - Fork 0
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 #34 from geoadmin/feat-pb-1108-delete-user
Add DELETE endpoint for users
- Loading branch information
Showing
4 changed files
with
78 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
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
from unittest.mock import patch | ||
|
||
from cognito.utils.user import create_cognito_user | ||
from cognito.utils.user import delete_user | ||
from cognito.utils.user import delete_cognito_user | ||
from cognito.utils.user import update_user | ||
|
||
from django.test import TestCase | ||
|
@@ -44,7 +44,7 @@ def test_create_user_does_not_create_existing_user(self, logger, client): | |
def test_delete_user_deletes_user(self, logger, client): | ||
client.return_value.delete_user.return_value = True | ||
|
||
deleted = delete_user(DummyUser('123', '[email protected]')) | ||
deleted = delete_cognito_user(DummyUser('123', '[email protected]')) | ||
|
||
self.assertEqual(deleted, True) | ||
self.assertIn(call.info('User %s deleted', '123'), logger.mock_calls) | ||
|
@@ -54,10 +54,12 @@ def test_delete_user_deletes_user(self, logger, client): | |
def test_delete_user_does_not_delete_nonexisting_user(self, logger, client): | ||
client.return_value.delete_user.return_value = False | ||
|
||
deleted = delete_user(DummyUser('123', '[email protected]')) | ||
deleted = delete_cognito_user(DummyUser('123', '[email protected]')) | ||
|
||
self.assertEqual(deleted, False) | ||
self.assertIn(call.warning('User %s does not exist, not deleted', '123'), logger.mock_calls) | ||
self.assertIn( | ||
call.critical('User %s does not exist, not deleted', '123'), logger.mock_calls | ||
) | ||
|
||
@patch('cognito.utils.user.Client') | ||
@patch('cognito.utils.user.logger') | ||
|
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