Only send heavy log-based stats for repository where required

This commit is contained in:
Joseph Schorr 2016-06-03 15:00:01 -04:00
parent 338f93c3c8
commit c3701cea7a
3 changed files with 37 additions and 19 deletions

View file

@ -1513,7 +1513,12 @@ class TestListRepos(ApiTestCase):
class TestViewPublicRepository(ApiTestCase):
def test_normalview(self):
self.getJsonResponse(Repository, params=dict(repository='public/publicrepo'))
resp = self.getJsonResponse(Repository, params=dict(repository='public/publicrepo'))
self.assertFalse('stats' in resp)
def test_normalview_withstats(self):
resp = self.getJsonResponse(Repository, params=dict(repository='public/publicrepo', includeStats=True))
self.assertTrue('stats' in resp)
def test_anon_access_disabled(self):
import features