From b375135a5a0be83d3df1e6e86e66552a6b7c7903 Mon Sep 17 00:00:00 2001 From: David Read Date: Mon, 29 Dec 2014 12:14:07 +0000 Subject: [PATCH] [#2141] Add test. --- ckan/new_tests/controllers/test_group.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ckan/new_tests/controllers/test_group.py b/ckan/new_tests/controllers/test_group.py index 38e4c54b7f4..b5fe63aec87 100644 --- a/ckan/new_tests/controllers/test_group.py +++ b/ckan/new_tests/controllers/test_group.py @@ -4,12 +4,28 @@ import ckan.new_tests.helpers as helpers import ckan.model as model +from ckan.new_tests import factories -class TestPackageControllerNew(helpers.FunctionalTestBase): +class TestGroupController(helpers.FunctionalTestBase): + + def setup(self): + model.repo.rebuild_db() def test_bulk_process_throws_404_for_nonexistent_org(self): app = self._get_test_app() bulk_process_url = url_for(controller='organization', action='bulk_process', id='does-not-exist') response = app.get(url=bulk_process_url, status=404) + + def test_page_thru_list_of_orgs(self): + orgs = [factories.Organization() for i in range(35)] + app = self._get_test_app() + org_url = url_for(controller='organization', action='index') + response = app.get(url=org_url) + assert orgs[0]['name'] in response + assert orgs[-1]['name'] not in response + + response2 = response.click('2') + assert orgs[0]['name'] not in response2 + assert orgs[-1]['name'] in response2