You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2014/03/25 15:27:31 UTC
[33/50] git commit: [#7051] Add tool _list paging test
[#7051] Add tool _list paging test
Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/35eee909
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/35eee909
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/35eee909
Branch: refs/heads/db/5995
Commit: 35eee909fa90d06efa34a39667db6345725bc177
Parents: 75393c3
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Mar 18 15:55:35 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Mar 18 16:31:07 2014 +0000
----------------------------------------------------------------------
Allura/allura/tests/functional/test_tool_list.py | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/35eee909/Allura/allura/tests/functional/test_tool_list.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_tool_list.py b/Allura/allura/tests/functional/test_tool_list.py
index 68416c6..08607cf 100644
--- a/Allura/allura/tests/functional/test_tool_list.py
+++ b/Allura/allura/tests/functional/test_tool_list.py
@@ -26,5 +26,19 @@ class TestToolListController(TestController):
def test_default(self):
"""Test that list page contains a link to all tools of that type."""
r = self.app.get('/p/test/_list/wiki')
- assert len(r.html.find('a', dict(href='/p/test/wiki/'))) == 1, r
- assert len(r.html.find('a', dict(href='/p/test/wiki2/'))) == 1, r
+ content = r.html.find('div', id='content_base')
+ assert content.find('a', dict(href='/p/test/wiki/')), r
+ assert content.find('a', dict(href='/p/test/wiki2/')), r
+
+ @td.with_wiki
+ @td.with_tool('test', 'Wiki', 'wiki2')
+ def test_paging(self):
+ """Test that list page handles paging correctly."""
+ r = self.app.get('/p/test/_list/wiki?limit=1&page=0')
+ content = r.html.find('div', id='content_base')
+ assert content.find('a', dict(href='/p/test/wiki/')), r
+ assert not content.find('a', dict(href='/p/test/wiki2/')), r
+ r = self.app.get('/p/test/_list/wiki?limit=1&page=1')
+ content = r.html.find('div', id='content_base')
+ assert not content.find('a', dict(href='/p/test/wiki/')), r
+ assert content.find('a', dict(href='/p/test/wiki2/')), r