|
a/Allura/allura/tests/test_security.py |
|
b/Allura/allura/tests/test_security.py |
1 |
from unittest import TestCase
|
1 |
from allura.tests import decorators as td
|
2 |
from allura import model as M
|
|
|
3 |
from allura.lib import plugin
|
|
|
4 |
|
|
|
5 |
from allura.tests import TestController
|
2 |
from allura.tests import TestController
|
6 |
|
|
|
7 |
from alluratest.controller import setup_basic_test, setup_unit_test
|
|
|
8 |
|
3 |
|
9 |
class TestSecurity(TestController):
|
4 |
class TestSecurity(TestController):
|
10 |
|
5 |
|
11 |
validate_skip = True
|
6 |
validate_skip = True
|
12 |
|
7 |
|
|
|
8 |
@td.with_wiki
|
13 |
def test_anon(self):
|
9 |
def test_anon(self):
|
14 |
self.app.get('/security/*anonymous/forbidden', status=302)
|
10 |
self.app.get('/security/*anonymous/forbidden', status=302)
|
15 |
self.app.get('/security/*anonymous/needs_auth', status=302)
|
11 |
self.app.get('/security/*anonymous/needs_auth', status=302)
|
16 |
self.app.get('/security/*anonymous/needs_project_access_fail', status=302)
|
12 |
self.app.get('/security/*anonymous/needs_project_access_fail', status=302)
|
17 |
self.app.get('/security/*anonymous/needs_artifact_access_fail', status=302)
|
13 |
self.app.get('/security/*anonymous/needs_artifact_access_fail', status=302)
|
18 |
|
14 |
|
|
|
15 |
@td.with_wiki
|
19 |
def test_auth(self):
|
16 |
def test_auth(self):
|
20 |
self.app.get('/security/test-admin/forbidden', status=403)
|
17 |
self.app.get('/security/test-admin/forbidden', status=403)
|
21 |
self.app.get('/security/test-admin/needs_auth', status=200)
|
18 |
self.app.get('/security/test-admin/needs_auth', status=200)
|
22 |
self.app.get('/security/test-admin/needs_project_access_fail', status=403)
|
19 |
self.app.get('/security/test-admin/needs_project_access_fail', status=403)
|
23 |
self.app.get('/security/test-admin/needs_project_access_ok', status=200)
|
20 |
self.app.get('/security/test-admin/needs_project_access_ok', status=200)
|