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 2021/03/09 18:02:19 UTC

[allura] branch master updated: py3 fix for kwargs on admin task view

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new 0abbda7  py3 fix for kwargs on admin task view
0abbda7 is described below

commit 0abbda76f6b5785003e3531a24ca3e04518d1907
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Tue Mar 9 13:02:10 2021 -0500

    py3 fix for kwargs on admin task view
---
 Allura/allura/templates/site_admin_task_view.html |  2 +-
 Allura/allura/tests/functional/test_site_admin.py | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Allura/allura/templates/site_admin_task_view.html b/Allura/allura/templates/site_admin_task_view.html
index 6306885..4e69988 100644
--- a/Allura/allura/templates/site_admin_task_view.html
+++ b/Allura/allura/templates/site_admin_task_view.html
@@ -152,7 +152,7 @@
         {% else %}
             {% set indexes = range(task.kwargs|length) %}
         {% endif %}
-        {% set kwargs = task.kwargs.items() %}
+        {% set kwargs = task.kwargs.items()|list %}
         {% for i in indexes %}
         <tr>
             <td class="first-column-headers"></td>
diff --git a/Allura/allura/tests/functional/test_site_admin.py b/Allura/allura/tests/functional/test_site_admin.py
index 05fcc5e..f7b11ef 100644
--- a/Allura/allura/tests/functional/test_site_admin.py
+++ b/Allura/allura/tests/functional/test_site_admin.py
@@ -133,13 +133,17 @@ class TestSiteAdmin(TestController):
         assert 'math.ceil' in r, r
 
     def test_task_view(self):
-        import math
-        task = M.MonQTask.post(math.ceil, (12.5,))
+        import re
+        task = M.MonQTask.post(re.search, ('pattern', 'string'), {'flags': re.I})
         url = '/nf/admin/task_manager/view/%s' % task._id
         r = self.app.get(
             url, extra_environ=dict(username=str('*anonymous')), status=302)
         r = self.app.get(url)
-        assert 'math.ceil' in r, r
+        assert 're.search' in r, r
+        assert '<td>pattern</td>' in r, r
+        assert '<td>string</td>' in r, r
+        assert '<th class="second-column-headers side-header">flags</th>' in r, r
+        assert '<td>{}</td>'.format(re.I) in r, r
         assert 'ready' in r, r
 
         # test resubmit too