Skip to content

Commit

Permalink
Merge branch 'ilja-dev-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed Dec 29, 2014
2 parents f5ee7db + b375135 commit 820a5b9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion ckan/new_tests/controllers/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion ckan/templates/organization/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1 class="hide-heading">{% block page_heading %}{{ _('Organizations') }}{% endb
{% endif %}
{% endblock %}
{% block page_pagination %}
{{ c.page.pager(q=c.q, sort=c.sort_by_selected) }}
{{ c.page.pager(q=c.q or '', sort=c.sort_by_selected or '') }}
{% endblock %}
{% endblock %}

Expand Down

0 comments on commit 820a5b9

Please sign in to comment.