Пример #1
0
 def testFilterViewableProjects_NonMemberCantViewMembersOnly(self):
   projects = list(sitewide_helpers.FilterViewableProjects(
       list(self.services.project.test_projects.values()),
       self.other_user, {OTHER_USER_ID}))
   self.assertProjectsAnyOrder(
       projects, self.regular_owner_live, self.regular_committer_live,
       self.other_owner_live, self.other_committer_live)
Пример #2
0
 def testFilterViewableProjects_CantViewArchived(self):
   projects = list(sitewide_helpers.FilterViewableProjects(
       list(self.services.project.test_projects.values()),
       self.regular_user, {REGULAR_USER_ID}))
   self.assertProjectsAnyOrder(
       projects, self.regular_owner_live, self.regular_committer_live,
       self.other_owner_live, self.other_committer_live,
       self.members_only_project)
Пример #3
0
 def testFilterViewableProjects_AdminCanViewAny(self):
   projects = list(sitewide_helpers.FilterViewableProjects(
       list(self.services.project.test_projects.values()),
       self.admin_user, {ADMIN_USER_ID}))
   self.assertProjectsAnyOrder(
       projects, self.regular_owner_live, self.regular_committer_live,
       self.other_owner_live, self.other_committer_live,
       self.members_only_project)