Merge pull request #2025 from coreos-inc/delete-org-sec-test
Add missing security test for delete org
This commit is contained in:
commit
13b4f10a34
2 changed files with 14 additions and 1 deletions
|
@ -212,8 +212,9 @@ class Organization(ApiResource):
|
||||||
raise NotFound()
|
raise NotFound()
|
||||||
|
|
||||||
model.user.delete_user(org, all_queues)
|
model.user.delete_user(org, all_queues)
|
||||||
|
return 'Deleted', 204
|
||||||
|
|
||||||
return 'Deleted', 204
|
raise Unauthorized()
|
||||||
|
|
||||||
|
|
||||||
@resource('/v1/organization/<orgname>/private')
|
@resource('/v1/organization/<orgname>/private')
|
||||||
|
|
|
@ -3568,6 +3568,18 @@ class TestOrganizationBuynlarge(ApiTestCase):
|
||||||
def test_put_devtable(self):
|
def test_put_devtable(self):
|
||||||
self._run_test('PUT', 200, 'devtable', {})
|
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):
|
class TestRepositoryPublicPublicrepo(ApiTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
Reference in a new issue