예제 #1
0
    def test_no_auth_on_non_public_project(self):
        self.project.is_public = False
        self.project.save()

        unauthenticated_client = Client()
        resp = unauthenticated_client.get('/api/data/mygroup/myproject?metric=foo&metric=bar/baz&environment=env1')
        self.assertEqual(401, resp.status_code)
예제 #2
0
파일: test_data.py 프로젝트: Linaro/squad
    def test_no_auth_on_non_public_project(self):
        self.project.is_public = False
        self.project.save()

        unauthenticated_client = Client()
        resp = unauthenticated_client.get('/api/data/mygroup/myproject?metric=foo&metric=bar/baz&environment=env1')
        self.assertEqual(401, resp.status_code)
예제 #3
0
    def test_auth_from_web_ui(self):
        self.project.is_public = False
        self.project.save()

        web_client = Client()
        user = User.objects.create(username='******')
        self.group.add_admin(user)
        web_client.force_login(user)

        resp = web_client.get('/api/data/mygroup/myproject?metric=foo&metric=bar/baz&environment=env1')
        self.assertEqual(200, resp.status_code)
예제 #4
0
파일: test_data.py 프로젝트: Linaro/squad
    def test_auth_from_web_ui(self):
        self.project.is_public = False
        self.project.save()

        web_client = Client()
        user = User.objects.create(username='******')
        self.group.add_admin(user)
        web_client.force_login(user)

        resp = web_client.get('/api/data/mygroup/myproject?metric=foo&metric=bar/baz&environment=env1')
        self.assertEqual(200, resp.status_code)