incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/8] git commit: [#4667] ticket:203 fix project_admins macro
Date Wed, 07 Nov 2012 21:00:48 GMT
Updated Branches:
  refs/heads/master ad2d70785 -> 682a6f692


[#4667] ticket:203 fix project_admins macro

* generate only one <br> between each project admin link


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

Branch: refs/heads/master
Commit: 682a6f6924030327900fbba3e25762b3d4850089
Parents: c24d8fe
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Mon Nov 5 12:11:24 2012 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Wed Nov 7 20:30:58 2012 +0000

----------------------------------------------------------------------
 Allura/allura/lib/macro.py          |    2 +-
 Allura/allura/tests/test_globals.py |    9 +++++++++
 2 files changed, 10 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/682a6f69/Allura/allura/lib/macro.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/macro.py b/Allura/allura/lib/macro.py
index 7b921eb..b21714e 100644
--- a/Allura/allura/lib/macro.py
+++ b/Allura/allura/lib/macro.py
@@ -325,7 +325,7 @@ def project_admins():
     output = ''
     admin_role = M.ProjectRole.query.get(project_id=c.project._id,name='Admin')
     if admin_role:
-        output = '\n'.join(
+        output = ''.join(
             template_project_admins.substitute(dict(
                 url=user_role.user.url(),
                 name=user_role.user.display_name))

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/682a6f69/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index 2a28b34..8e17731 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -149,6 +149,15 @@ def test_macro_project_admins():
     r = g.markdown_wiki.convert('[[project_admins]]')
     assert_equal(r, '<div class="markdown_content"><p><a href="/u/test-admin/">Test
Admin</a><br /></p></div>')
 
+def test_macro_project_admins_one_br():
+    p_nbhd = M.Neighborhood.query.get(name='Projects')
+    p_test = M.Project.query.get(shortname='test', neighborhood_id=p_nbhd._id)
+    p_test.add_user(M.User.by_username('test-user'), ['Admin'])
+    ThreadLocalORMSession.flush_all()
+    r = g.markdown_wiki.convert('[[project_admins]]\n[[download_button]]')
+    assert not '</a><br /><br /><a href=' in r, r
+    assert '</a><br /><a href=' in r, r
+
 def test_markdown_toc():
     r = g.markdown_wiki.convert("""[TOC]
 


Mime
View raw message