forked from inveniosoftware/invenio-users-resources
-
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.
* addresses inveniosoftware#23
- Loading branch information
Showing
9 changed files
with
234 additions
and
27 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
# Copyright (C) 2022 European Union. | ||
# Copyright (C) 2022 CERN. | ||
# Copyright (C) 2024 KTH Royal Institute of Technology. | ||
# Copyright (C) 2024 Ubiquity Press. | ||
# | ||
# Invenio-Users-Resources is free software; you can redistribute it and/or | ||
# modify it under the terms of the MIT License; see LICENSE file for more | ||
|
@@ -115,6 +116,23 @@ def test_user_avatar(client, user_pub): | |
# | ||
# Management / moderation | ||
# | ||
def test_create_user(client, headers, user_moderator, db): | ||
"""Tests approve user endpoint.""" | ||
client = user_moderator.login(client) | ||
res = client.post( | ||
"/users", | ||
json={ | ||
"username": "newuser", | ||
"email": "[email protected]", | ||
}, | ||
headers=headers, | ||
) | ||
assert res.status_code == 201 | ||
|
||
res = client.get(f"/users/{res.json['id']}") | ||
assert res.status_code == 200 | ||
assert res.json["active"] == True | ||
assert res.json["email"] == "[email protected]" | ||
|
||
|
||
def test_approve_user(client, headers, user_pub, user_moderator, db): | ||
|
Oops, something went wrong.