-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fixes #11995] Implement POST and PATCH methods for the User API
- Loading branch information
1 parent
4bad53a
commit c0c4dfb
Showing
3 changed files
with
21 additions
and
7 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 |
---|---|---|
|
@@ -388,9 +388,7 @@ def test_register_users(self): | |
Ensure users are created with default groups. | ||
""" | ||
url = reverse("users-list") | ||
user_data = { | ||
"username": "new_user", | ||
} | ||
user_data = {"username": "new_user", "password": "@!2XJSL_S&V^0nt", "email": "[email protected]"} | ||
self.assertTrue(self.client.login(username="admin", password="admin")) | ||
response = self.client.post(url, data=user_data, format="json") | ||
self.assertEqual(response.status_code, 201) | ||
|
@@ -472,6 +470,8 @@ def test_delete_user_profile(self): | |
self.assertEqual(response.status_code, 403) | ||
# Admin can delete user | ||
self.assertTrue(self.client.login(username="admin", password="admin")) | ||
self.client.force_login(get_user_model().objects.get(username="admin")) | ||
print("kalon") | ||
response = self.client.delete(url, format="json") | ||
self.assertEqual(response.status_code, 204) | ||
finally: | ||
|
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