allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject allura git commit: [#8051] Update failing mount_order tests
Date Wed, 09 Mar 2016 23:18:21 GMT
Repository: allura
Updated Branches:
  refs/heads/master f9abee3db -> 9acc99ed5


[#8051] Update failing mount_order tests


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

Branch: refs/heads/master
Commit: 9acc99ed51f4a2a84c7a96ea5270aa1a3e6418a0
Parents: f9abee3
Author: Heith Seewald <heiths@gmail.com>
Authored: Wed Mar 9 18:16:32 2016 -0500
Committer: Heith Seewald <heiths@gmail.com>
Committed: Wed Mar 9 18:16:32 2016 -0500

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_admin.py | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/9acc99ed/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index 153cfb3..2d9651b 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -25,7 +25,7 @@ import logging
 
 import tg
 import PIL
-from nose.tools import assert_equals, assert_in, assert_not_in, assert_is_not_none
+from nose.tools import assert_equals, assert_in, assert_not_in, assert_is_not_none, assert_greater
 from ming.orm.ormsession import ThreadLocalORMSession
 from tg import expose
 from pylons import tmpl_context as c, app_globals as g
@@ -1390,20 +1390,29 @@ class TestRestMountOrder(TestRestApiBase):
         assert_equals(r.status, '400 Bad Request')
         assert_in('Invalid kw: expected "ordinal: mount_point"', r.body)
 
+    @td.with_wiki
     def test_reorder(self):
         data = {
-            '0': u'sub1',
-            '1': u'admin'
+            '0': u'wiki',
+            '1': u'sub1',
+            '2': u'admin'
         }
 
-        before_reorder = self.api_get('/p/test/_nav.json')
-        assert_equals(before_reorder.json['menu'][0]['mount_point'], 'sub1')
+        tool = {
+            u'icon': u'tool-admin',
+            u'is_anchored': False,
+            u'mount_point': u'sub1',
+            u'name': u'A Subproject',
+            u'tool_name': u'sub',
+            u'url': u'/p/test/sub1/'
+        }
 
+        a = self.api_get('/p/test/_nav.json').json['menu'].index(tool)
         r = self.api_post('/rest/p/test/admin/mount_order/', **data)
         assert_equals(r.json['status'], 'ok')
-
         after_reorder = self.api_get('/p/test/_nav.json')
-        assert_equals(after_reorder.json['menu'][1]['mount_point'], 'admin')
+        b = after_reorder.json['menu'].index(tool)
+        assert_greater(b, a)
 
 
 class TestRestToolGrouping(TestRestApiBase):


Mime
View raw message