def test_teams_access(self):
        """
        Check private project teams' pages access.
        """
        URLs = {
            'anonymous' : {
                403 : [
                    '/projects/p/%s/teams/' % self.project_private.slug,
                    '/projects/p/%s/team/%s/' % (self.project_private.slug,
                         self.language.code)
                ],
                302 : [
                    '/projects/p/%s/teams/add/' % self.project_private.slug,
                    '/projects/p/%s/team/%s/edit/' % (self.project_private.slug,
                        self.language.code),
                    '/projects/p/%s/team/%s/delete/' % (self.project_private.slug,
                         self.language.code),
                    '/projects/p/%s/team/%s/request/' % (self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/approve/%s/' % (self.project_private.slug, self.language.code,
                        self.user['team_member'].username),
                    '/projects/p/%s/team/%s/deny/%s/' % (self.project_private.slug, self.language.code,
                        self.user['team_member'].username),
                    '/projects/p/%s/team/%s/withdraw/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/leave/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/teams/request/' % self.project_private.slug,
                    '/projects/p/%s/team/%s/approve/' % (self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/deny/' %(self.project_private.slug, self.language.code),
                ]
            },
            'registered' : {
                403 : [
                    '/projects/p/%s/teams/' % self.project_private.slug, # FIXME: returns 200
                    '/projects/p/%s/team/%s/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/teams/add/' % self.project_private.slug,
                    '/projects/p/%s/team/%s/edit/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/delete/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/request/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/approve/%s/' % (self.project_private.slug, self.language.code,
                        self.user['team_member'].username),
                    '/projects/p/%s/team/%s/deny/%s/' % (self.project_private.slug, self.language.code,
                        self.user['team_member'].username),
                    '/projects/p/%s/team/%s/withdraw/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/leave/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/teams/request/' % self.project_private.slug,
                    '/projects/p/%s/team/%s/approve/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/deny/' %(self.project_private.slug, self.language.code)
                ]
            },
            'maintainer' : {
                200 : [
                    '/projects/p/%s/teams/' % self.project_private.slug, #200
                    '/projects/p/%s/team/%s/' %(self.project_private.slug, self.language.code), #200
                    '/projects/p/%s/teams/add/' % self.project_private.slug, #200
                    '/projects/p/%s/team/%s/edit/' %(self.project_private.slug, self.language.code), #200
                    '/projects/p/%s/team/%s/delete/' %(self.project_private.slug, self.language.code) #200
                ],
                302 : [
                    '/projects/p/%s/team/%s/request/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/leave/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/teams/request/' % self.project_private.slug
                ],
                404 : [
                    '/projects/p/%s/team/%s/approve/%s/' % (self.project_private.slug, self.language.code,
                        self.user['team_member'].username),
                    '/projects/p/%s/team/%s/deny/%s/' % (self.project_private.slug, self.language.code,
                        self.user['team_member'].username),
                    '/projects/p/%s/team/%s/withdraw/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/approve/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/deny/' %(self.project_private.slug, self.language.code)
                ],
            },
            #'writer' : {
            #    200 : [
            #        '/projects/p/%s/teams/',
            #        '/projects/p/%s/team/%s/' %(self.project_private.slug, self.language.code)
            #    ],
            #    302 : [
            #        '/projects/p/%s/team/%s/request/' %(self.project_private.slug, self.language.code),
            #        '/projects/p/%s/team/%s/leave/' %(self.project_private.slug, self.language.code),
            #        '/projects/p/%s/teams/request/'
            #    ],
            #    404 : [
            #        '/projects/p/%s/team/%s/withdraw/' %(self.project_private.slug, self.language.code)
            #    ],
            #    403 : [
            #        '/projects/p/%s/teams/add/',
            #        '/projects/p/%s/team/%s/edit/' %(self.project_private.slug, self.language.code),
            #        '/projects/p/%s/team/%s/delete/' %(self.project_private.slug, self.language.code),
            #        '/projects/p/%s/team/%s/approve/%s/' % (self.project_private.slug, self.language.code,
            #            self.user['team_member'].username),
            #        '/projects/p/%s/team/%s/deny/%s/' % (self.project_private.slug, self.language.code,
            #            self.user['team_member'].username),
            #        '/projects/p/%s/team/%s/approve/' %(self.project_private.slug, self.language.code),
            #        '/projects/p/%s/team/%s/deny/' %(self.project_private.slug, self.language.code)
            #    ]
            #},
            'team_coordinator' : {
                200 : [
                    '/projects/p/%s/teams/' % self.project_private.slug,
                    '/projects/p/%s/team/%s/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/edit/' %(self.project_private.slug, self.language.code)
                ],
                302 : [
                    '/projects/p/%s/team/%s/request/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/leave/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/teams/request/' % self.project_private.slug
                ],
                404 : [
                    '/projects/p/%s/team/%s/withdraw/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/approve/%s/' % (self.project_private.slug, self.language.code,
                        self.user['team_member'].username),
                    '/projects/p/%s/team/%s/deny/%s/' % (self.project_private.slug, self.language.code,
                        self.user['team_member'].username)
                ],
                403 : [
                    '/projects/p/%s/teams/add/' % self.project_private.slug,
                    '/projects/p/%s/team/%s/delete/' %(self.project_private.slug, self.language.code),
                    # TODO: Add a second team to check if coordinator has access too.
                    '/projects/p/%s/team/%s/approve/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/deny/' %(self.project_private.slug, self.language.code)
                ]
            },
            'team_member' : {
                200 : [
                     '/projects/p/%s/teams/' % self.project_private.slug,
                    '/projects/p/%s/team/%s/' %(self.project_private.slug, self.language.code)
                ],
                302 : [
                    '/projects/p/%s/team/%s/request/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/leave/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/teams/request/' % self.project_private.slug
                ],
                404 : [
                    '/projects/p/%s/team/%s/withdraw/' %(self.project_private.slug, self.language.code),
                ],
                403 : [
                    '/projects/p/%s/teams/add/' % self.project_private.slug,
                    '/projects/p/%s/team/%s/edit/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/delete/' %(self.project_private.slug, self.language.code),
                    # TODO: Add a second team to check if coordinator has access too.
                    '/projects/p/%s/team/%s/approve/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/deny/' %(self.project_private.slug, self.language.code),
                    '/projects/p/%s/team/%s/approve/%s/' % (self.project_private.slug, self.language.code,
                        self.user['team_member'].username),
                    '/projects/p/%s/team/%s/deny/%s/' % (self.project_private.slug, self.language.code,
                        self.user['team_member'].username)
                ]
            }
        }

        for user in URLs.keys():
            for status_code in URLs[user].keys():
                for url in URLs[user][status_code]:
                    response = self.client[user].get(url)
                    self.failUnlessEqual(response.status_code, status_code,
                        "Wrong status code for user '%s' and url '%s' ( %s != %s)" % (
                        user, url, response.status_code,status_code))
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/projects/tests/private_projects.py/PrivateProjectTest.test_teams_access/original