Merge pull request #2025 from coreos-inc/delete-org-sec-test

Add missing security test for delete org
This commit is contained in:
josephschorr 2016-10-21 17:41:39 -04:00 committed by GitHub
commit 13b4f10a34
2 changed files with 14 additions and 1 deletions

View file

@ -212,8 +212,9 @@ class Organization(ApiResource):
raise NotFound()
model.user.delete_user(org, all_queues)
return 'Deleted', 204
return 'Deleted', 204
raise Unauthorized()
@resource('/v1/organization/<orgname>/private')

View file

@ -3568,6 +3568,18 @@ class TestOrganizationBuynlarge(ApiTestCase):
def test_put_devtable(self):
self._run_test('PUT', 200, 'devtable', {})
def test_delete_anonymous(self):
self._run_test('DELETE', 401, None, {})
def test_delete_freshuser(self):
self._run_test('DELETE', 403, 'freshuser', {})
def test_delete_reader(self):
self._run_test('DELETE', 403, 'reader', {})
def test_delete_devtable(self):
self._run_test('DELETE', 204, 'devtable', {})
class TestRepositoryPublicPublicrepo(ApiTestCase):
def setUp(self):