Commit a7dad6e8 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

astakos: Some more project tests

parent b0ab28c0
......@@ -419,6 +419,11 @@ class ProjectAPITest(TestCase):
body = json.loads(r.content)
self.assertEqual(len(body), 4)
filters = {"mode": "member"}
r = client.get(reverse("api_projects"), filters, **h_owner)
body = json.loads(r.content)
self.assertEqual(len(body), 2)
# Leave failed
status = self.memb_action(m_plain_id, "leave", h_owner)
self.assertEqual(status, 403)
......@@ -617,6 +622,21 @@ class ProjectAPITest(TestCase):
r = client.get(reverse("api_projects"), filters, **h_owner)
self.assertEqual(r.status_code, 400)
# directly modify a base project
with assertRaises(functions.ProjectBadRequest):
functions.modify_project(self.user1.uuid,
{"description": "new description",
"member_join_policy":
functions.MODERATED_POLICY})
functions.modify_project(self.user1.uuid,
{"member_join_policy":
functions.MODERATED_POLICY})
r = client.get(reverse("api_project",
kwargs={"project_id": self.user1.uuid}),
**h_owner)
body = json.loads(r.content)
self.assertEqual(body["join_policy"], "moderated")
class TestProjects(TestCase):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment