incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [01/17] git commit: [#7051] Add tool _list paging test
Date Thu, 20 Mar 2014 18:46:34 GMT
Repository: incubator-allura
Updated Branches:
  refs/heads/cj/6701 a3dc656d6 -> f970d43d4 (forced update)


[#7051] Add tool _list paging test

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/35eee909
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/35eee909
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/35eee909

Branch: refs/heads/cj/6701
Commit: 35eee909fa90d06efa34a39667db6345725bc177
Parents: 75393c3
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Tue Mar 18 15:55:35 2014 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@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/incubator-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


Mime
View raw message