We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
GET
1 parent 45a7e4b commit 2e42fa5Copy full SHA for 2e42fa5
src/plone/restapi/tests/test_services_users.py
@@ -169,6 +169,15 @@ def test_list_users_filtered(self):
169
user_ids = [user["id"] for user in response.json()["items"]]
170
self.assertNotIn("otheruser", user_ids)
171
172
+ def test_list_users_via_csv(self):
173
+ resp = self.api_session.get("/@users", headers={"Accept": "text/csv"})
174
+
175
+ self.assertEqual(resp.status_code, 200)
176
+ self.assertIn("Content-Disposition", resp.headers)
177
+ self.assertEqual(resp.headers["Content-Type"], "text/csv; charset=utf-8")
178
+ content = b'id,username,fullname,email,roles,groups\r\nadmin,admin,,,Manager,AuthenticatedUsers\r\ntest_user_1_,test-user,,,Manager,AuthenticatedUsers\r\nnoam,noam,Noam Avram Chomsky,[email protected],Member,AuthenticatedUsers\r\notheruser,otheruser,Other user,[email protected],"Member, Reviewer","AuthenticatedUsers, Reviewers"\r\n'
179
+ self.assertEqual(resp.content, content)
180
181
def test_add_user(self):
182
response = self.api_session.post(
183
"/@users",
0 commit comments