Revision 5d3a191e snf-astakos-app/astakos/im/tests/projects.py

b/snf-astakos-app/astakos/im/tests/projects.py
419 419
        body = json.loads(r.content)
420 420
        self.assertEqual(len(body), 4)
421 421

  
422
        filters = {"mode": "member"}
423
        r = client.get(reverse("api_projects"), filters, **h_owner)
424
        body = json.loads(r.content)
425
        self.assertEqual(len(body), 2)
426

  
422 427
        # Leave failed
423 428
        status = self.memb_action(m_plain_id, "leave", h_owner)
424 429
        self.assertEqual(status, 403)
......
617 622
        r = client.get(reverse("api_projects"), filters, **h_owner)
618 623
        self.assertEqual(r.status_code, 400)
619 624

  
625
        # directly modify a base project
626
        with assertRaises(functions.ProjectBadRequest):
627
            functions.modify_project(self.user1.uuid,
628
                                     {"description": "new description",
629
                                      "member_join_policy":
630
                                          functions.MODERATED_POLICY})
631
        functions.modify_project(self.user1.uuid,
632
                                 {"member_join_policy":
633
                                      functions.MODERATED_POLICY})
634
        r = client.get(reverse("api_project",
635
                               kwargs={"project_id": self.user1.uuid}),
636
                       **h_owner)
637
        body = json.loads(r.content)
638
        self.assertEqual(body["join_policy"], "moderated")
639

  
620 640

  
621 641
class TestProjects(TestCase):
622 642
    """

Also available in: Unified diff