Merge pull request #598 from coreos-inc/limitbadquery

Prevent unlimited insane query from running and fix tests
This commit is contained in:
josephschorr 2015-10-05 21:29:35 -04:00
commit 3e7a95407b
4 changed files with 15 additions and 8 deletions

View file

@ -1331,14 +1331,14 @@ class TestListRepos(ApiTestCase):
self.assertEquals(len(json['repositories']), 1)
def test_listrepos_orgmember(self):
def test_listrepos_asorgmember(self):
self.login(READ_ACCESS_USER)
# Queries: Base + the list query
with assert_query_count(BASE_LOGGEDIN_QUERY_COUNT + 1):
json = self.getJsonResponse(RepositoryList, params=dict(public=True))
self.assertGreater(len(json['repositories']), 1)
self.assertGreater(len(json['repositories']), 0)
def test_listrepos_filter(self):
self.login(READ_ACCESS_USER)
@ -1353,7 +1353,7 @@ class TestListRepos(ApiTestCase):
def test_listrepos_limit(self):
self.login(READ_ACCESS_USER)
json = self.getJsonResponse(RepositoryList, params=dict(limit=1))
json = self.getJsonResponse(RepositoryList, params=dict(limit=1, public=True))
self.assertEquals(len(json['repositories']), 1)
def test_listrepos_allparams(self):