• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Révisione5b93e1069d751591ce1dbd19b42cc6b1938a5f0 (tree)
l'heure2012-01-07 04:23:40
AuteurTim Van Steenburgh <tvansteenburgh@geek...>
CommiterTim Van Steenburgh

Message de Log

[#3417] Only install tools needed for tests.

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@geek.net>

Change Summary

Modification

--- /dev/null
+++ b/Allura/allura/tests/decorators.py
@@ -0,0 +1,47 @@
1+from functools import wraps
2+
3+from allura import model as M
4+
5+from ming.orm.ormsession import ThreadLocalORMSession
6+
7+from pylons import c
8+
9+
10+def with_tool(project_shortname, ep_name, mount_point=None, mount_label=None,
11+ ordinal=None, post_install_hook=None, **override_options):
12+ def _with_tool(func):
13+ @wraps(func)
14+ def wrapped(*args, **kw):
15+ c.user = M.User.by_username('test-admin')
16+ p = M.Project.query.get(shortname=project_shortname)
17+ c.project = p
18+ if mount_point and not p.app_instance(mount_point):
19+ c.app = p.install_app(ep_name, mount_point, mount_label, ordinal, **override_options)
20+ if post_install_hook:
21+ post_install_hook(c.app)
22+ while M.MonQTask.run_ready('setup'):
23+ pass
24+ ThreadLocalORMSession.flush_all()
25+ ThreadLocalORMSession.close_all()
26+ elif mount_point:
27+ c.app = p.app_instance(mount_point)
28+ return func(*args, **kw)
29+ return wrapped
30+ return _with_tool
31+
32+with_discussion = with_tool('test', 'Discussion', 'discussion')
33+with_link = with_tool('test', 'Link', 'link')
34+with_tracker = with_tool('test', 'Tickets', 'bugs')
35+with_wiki = with_tool('test', 'Wiki', 'wiki')
36+with_git = with_tool('test', 'Git', 'src-git', 'Git', type='git')
37+with_hg = with_tool('test', 'Hg', 'src-hg', 'Mercurial', type='hg')
38+with_svn = with_tool('test', 'SVN', 'src', 'SVN')
39+
40+def with_repos(func):
41+ @wraps(func)
42+ @with_git
43+ @with_hg
44+ @with_svn
45+ def wrapped(*args, **kw):
46+ return func(*args, **kw)
47+ return wrapped
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -2,9 +2,7 @@ import os, allura
22 import pkg_resources
33 import Image, StringIO
44
5-from nose.tools import assert_equals, assert_true
6-from pylons import g, c
7-
5+from nose.tools import assert_equals
86 from ming.orm.ormsession import ThreadLocalORMSession
97
108 try:
@@ -13,9 +11,8 @@ except ImportError:
1311 sfx = None
1412
1513 from allura.tests import TestController
14+from allura.tests import decorators as td
1615 from allura import model as M
17-from allura.lib import helpers as h
18-
1916
2017 class TestProjectAdmin(TestController):
2118
@@ -443,6 +440,7 @@ class TestProjectAdmin(TestController):
443440 r = self.app.get('/admin/groups/')
444441 assert 'test-user' not in str(r), r.showbrowser()
445442
443+ @td.with_wiki
446444 def test_new_group(self):
447445 r = self.app.get('/admin/groups/new', validate_chunk=True)
448446 r = self.app.post('/admin/groups/create', params={'name': 'Developer'})
--- a/Allura/allura/tests/functional/test_auth.py
+++ b/Allura/allura/tests/functional/test_auth.py
@@ -3,8 +3,8 @@ import json
33 from datadiff.tools import assert_equal
44
55 from allura.tests import TestController
6+from allura.tests import decorators as td
67 from allura import model as M
7-from allura.lib import helpers as h
88 from ming.orm.ormsession import ThreadLocalORMSession
99
1010
@@ -157,6 +157,7 @@ class TestAuth(TestController):
157157 # Make sure that default _lookup() throws 404
158158 self.app.get('/auth/foobar', status=404)
159159
160+ @td.with_svn
160161 def test_refresh_repo(self):
161162 r = self.app.get('/auth/refresh_repo')
162163 assert_equal(r.body, 'No repo specified')
@@ -185,22 +186,26 @@ class TestUserPermissions(TestController):
185186 r = self._check_repo('/git/test/bar')
186187 assert r == self.disallow, r
187188
189+ @td.with_svn
188190 def test_repo_write(self):
189191 r = self._check_repo('/git/test/src.git')
190192 assert r == self.allow, r
191193 r = self._check_repo('/git/test/src')
192194 assert r == self.allow, r
193195
196+ @td.with_svn
194197 def test_subdir(self):
195198 r = self._check_repo('/git/test/src.git/foo')
196199 assert r == self.allow, r
197200 r = self._check_repo('/git/test/src/foo')
198201 assert r == self.allow, r
199202
203+ @td.with_svn
200204 def test_neighborhood(self):
201205 r = self._check_repo('/git/test.p/src.git')
202206 assert r == self.allow, r
203207
208+ @td.with_svn
204209 def test_repo_read(self):
205210 r = self._check_repo(
206211 '/git/test.p/src.git',
@@ -223,6 +228,7 @@ class TestUserPermissions(TestController):
223228 except:
224229 return r
225230
231+ @td.with_repos
226232 def test_list_repos(self):
227233 r = self.app.get('/auth/repo_permissions', params=dict(username='test-admin'), status=200)
228234 assert_equal(json.loads(r.body), {"allow_write": [
--- a/Allura/allura/tests/functional/test_feeds.py
+++ b/Allura/allura/tests/functional/test_feeds.py
@@ -1,15 +1,16 @@
1-from pylons import g
21 from formencode.variabledecode import variable_encode
32
4-from ming.orm.ormsession import ThreadLocalORMSession
5-
63 from allura.tests import TestController
7-from allura import model as M
4+from allura.tests import decorators as td
85
96 class TestFeeds(TestController):
10-
117 def setUp(self):
128 TestController.setUp(self)
9+ self._setUp()
10+
11+ @td.with_wiki
12+ @td.with_tracker
13+ def _setUp(self):
1314 self.app.get('/wiki/')
1415 self.app.get('/bugs/')
1516 self.app.post(
@@ -39,10 +40,12 @@ class TestFeeds(TestController):
3940 self.app.get('/feed.rss')
4041 self.app.get('/feed.atom')
4142
43+ @td.with_wiki
4244 def test_wiki_feed(self):
4345 self.app.get('/wiki/feed.rss')
4446 self.app.get('/wiki/feed.atom')
4547
48+ @td.with_wiki
4649 def test_wiki_page_feed(self):
4750 self.app.post('/wiki/Root/update', params={
4851 'title':'Root',
@@ -53,10 +56,12 @@ class TestFeeds(TestController):
5356 self.app.get('/wiki/Root/feed.rss')
5457 self.app.get('/wiki/Root/feed.atom')
5558
59+ @td.with_tracker
5660 def test_ticket_list_feed(self):
5761 self.app.get('/bugs/feed.rss')
5862 self.app.get('/bugs/feed.atom')
5963
64+ @td.with_tracker
6065 def test_ticket_feed(self):
6166 self.app.get('/bugs/1/feed.rss')
6267 r = self.app.get('/bugs/1/feed.atom')
--- a/Allura/allura/tests/functional/test_home.py
+++ b/Allura/allura/tests/functional/test_home.py
@@ -1,15 +1,13 @@
11 import json
2-from pylons import g
3-from formencode.variabledecode import variable_encode
4-
5-from ming.orm.ormsession import ThreadLocalORMSession
62
73 from allura.tests import TestController
4+from allura.tests import decorators as td
85 from allura import model as M
96
107
118 class TestProjectHome(TestController):
129
10+ @td.with_wiki
1311 def test_project_nav(self):
1412 response = self.app.get('/p/test/_nav.json')
1513 root = self.app.get('/p/test/wiki/').follow()
@@ -18,6 +16,7 @@ class TestProjectHome(TestController):
1816 for nl, entry in zip(nav_links, response.json['menu']):
1917 assert nl['href'] == entry['url']
2018
19+ @td.with_wiki
2120 def test_neighborhood_home(self):
2221 self.app.get('/p/test/wiki/', status=302)
2322 self.app.get('/adobe/test/wiki/', status=404)
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -4,14 +4,11 @@ from cStringIO import StringIO
44
55 import Image
66 from tg import config
7-from pylons import g, c
8-
9-from ming.orm.ormsession import ThreadLocalORMSession
107
118 import allura
129 from allura import model as M
1310 from allura.tests import TestController
14-
11+from allura.tests import decorators as td
1512
1613 class TestNeighborhood(TestController):
1714
@@ -330,6 +327,7 @@ class TestNeighborhood(TestController):
330327 r = self.app.get('/p/check_name?project_name=test')
331328 assert r.json['message'] == 'This project name is taken.'
332329
330+ @td.with_tool('test/sub1', 'Wiki', 'wiki')
333331 def test_neighborhood_project(self):
334332 self.app.get('/adobe/adobe-1/admin/', status=200)
335333 self.app.get('/p/test/sub1/wiki/')
--- a/Allura/allura/tests/functional/test_rest.py
+++ b/Allura/allura/tests/functional/test_rest.py
@@ -1,14 +1,7 @@
1-from pprint import pprint
21 from datetime import datetime, timedelta
3-import json
4-
5-from pylons import c
6-from ming.orm import session
7-
8-from allura import model as M
9-from allura.lib import helpers as h
10-from alluratest.controller import TestController, TestRestApiBase
112
3+from allura.tests import decorators as td
4+from alluratest.controller import TestRestApiBase
125
136 class TestRestHome(TestRestApiBase):
147
@@ -36,11 +29,13 @@ class TestRestHome(TestRestApiBase):
3629 r = self.api_post('/rest/p/test/admin/')
3730 assert r.status_int == 404
3831
32+ @td.with_wiki
3933 def test_project_ping(self):
4034 r = self.api_get('/rest/p/test/wiki/Home/')
4135 assert r.status_int == 200
4236 assert r.json['title'] == 'Home', r.json
4337
38+ @td.with_tool('test/sub1', 'Wiki', 'wiki')
4439 def test_subproject_ping(self):
4540 r = self.api_get('/rest/p/test/sub1/wiki/Home/')
4641 assert r.status_int == 200
--- a/Allura/allura/tests/functional/test_rest_api_tickets.py
+++ b/Allura/allura/tests/functional/test_rest_api_tickets.py
@@ -1,13 +1,10 @@
1-from pprint import pprint
21 from datetime import datetime, timedelta
3-import json
42
5-from pylons import c
63 from ming.orm import session
74
85 from allura import model as M
9-from allura.lib import helpers as h
10-from alluratest.controller import TestController, TestRestApiBase
6+from allura.tests import decorators as td
7+from alluratest.controller import TestRestApiBase
118
129
1310 class TestApiTicket(TestRestApiBase):
@@ -49,6 +46,7 @@ class TestApiTicket(TestRestApiBase):
4946 r = self.api_post('/rest/p/test/admin/')
5047 assert r.status_int == 404
5148
49+ @td.with_wiki
5250 def test_project_ping(self):
5351 self.set_api_ticket()
5452 r = self.api_get('/rest/p/test/wiki/Home/')
@@ -60,6 +58,7 @@ class TestApiTicket(TestRestApiBase):
6058 r = self.api_post('/rest/p/test/wiki/')
6159 assert r.status_int == 403
6260
61+ @td.with_tool('test/sub1', 'Wiki', 'wiki')
6362 def test_subproject_ping(self):
6463 self.set_api_ticket()
6564 r = self.api_get('/rest/p/test/sub1/wiki/Home/')
--- a/Allura/allura/tests/functional/test_root.py
+++ b/Allura/allura/tests/functional/test_root.py
@@ -12,12 +12,11 @@ Please read http://pythonpaste.org/webtest/ for more information.
1212 """
1313 from urllib import quote
1414
15-from nose.tools import assert_true, assert_equal
15+from nose.tools import assert_equal
1616
17+from allura.tests import decorators as td
1718 from allura.tests import TestController
1819 from allura import model as M
19-from ming.orm import session
20-
2120
2221 class TestRootController(TestController):
2322
@@ -89,6 +88,7 @@ class TestRootController(TestController):
8988 assert len(response.html.findAll('img',{'alt':'adobe-1 Logo'})) == 0
9089 assert len(response.html.findAll('img',{'alt':'adobe-2 Logo'})) == 1
9190
91+ @td.with_wiki
9292 def test_markdown_to_html(self):
9393 n = M.Neighborhood.query.get(name='Projects')
9494 r = self.app.get('/nf/markdown_to_html?markdown=*aaa*bb[wiki:Home]&project=test&app=bugs&neighborhood=%s' % n._id, validate_chunk=True)
--- a/Allura/allura/tests/functional/test_user_profile.py
+++ b/Allura/allura/tests/functional/test_user_profile.py
@@ -1,8 +1,8 @@
11 from formencode.variabledecode import variable_encode
22
3+from allura.tests import decorators as td
34 from allura.tests import TestController
45
5-
66 class TestUserProfile(TestController):
77
88 def test_profile(self):
@@ -28,6 +28,7 @@ class TestUserProfile(TestController):
2828 response = self.app.get('/u/test-user/profile/')
2929 assert 'Email Addresses' not in response
3030
31+ @td.with_wiki
3132 def test_feed(self):
3233 response = self.app.get('/u/test-admin/profile/feed')
3334 assert 'Recent posts by Test Admin' in response
--- a/Allura/allura/tests/model/test_artifact.py
+++ b/Allura/allura/tests/model/test_artifact.py
@@ -16,6 +16,7 @@ import allura
1616 from allura import model as M
1717 from allura.lib import helpers as h
1818 from allura.lib import security
19+from allura.tests import decorators as td
1920 from allura.websetup.schema import REGISTRY
2021 from alluratest.controller import setup_basic_test, setup_unit_test
2122 from forgewiki import model as WM
@@ -34,6 +35,10 @@ Mapper.compile_all()
3435 def setUp():
3536 setup_basic_test()
3637 setup_unit_test()
38+ setup_with_tools()
39+
40+@td.with_wiki
41+def setup_with_tools():
3742 h.set_context('test', 'wiki', neighborhood='Projects')
3843 Checkmessage.query.remove({})
3944 WM.Page.query.remove({})
--- a/Allura/allura/tests/model/test_notification.py
+++ b/Allura/allura/tests/model/test_notification.py
@@ -8,12 +8,17 @@ from ming.orm import ThreadLocalORMSession
88 from alluratest.controller import setup_basic_test, setup_global_objects, REGISTRY
99 from allura import model as M
1010 from allura.lib import helpers as h
11+from allura.tests import decorators as td
1112 from forgewiki import model as WM
1213
1314 class TestNotification(unittest.TestCase):
1415
1516 def setUp(self):
1617 setup_basic_test()
18+ self.setup_with_tools()
19+
20+ @td.with_wiki
21+ def setup_with_tools(self):
1722 setup_global_objects()
1823 _clear_subscriptions()
1924 _clear_notifications()
@@ -46,6 +51,10 @@ class TestPostNotifications(unittest.TestCase):
4651
4752 def setUp(self):
4853 setup_basic_test()
54+ self.setup_with_tools()
55+
56+ @td.with_wiki
57+ def setup_with_tools(self):
4958 setup_global_objects()
5059 g.set_app('wiki')
5160 _clear_subscriptions()
@@ -147,6 +156,10 @@ class TestSubscriptionTypes(unittest.TestCase):
147156
148157 def setUp(self):
149158 setup_basic_test()
159+ self.setup_with_tools()
160+
161+ @td.with_wiki
162+ def setup_with_tools(self):
150163 setup_global_objects()
151164 g.set_app('wiki')
152165 _clear_subscriptions()
--- a/Allura/allura/tests/model/test_project.py
+++ b/Allura/allura/tests/model/test_project.py
@@ -2,22 +2,22 @@
22 """
33 Model tests for project
44 """
5-from datetime import datetime
6-
7-import mock
85 from nose.tools import with_setup
9-from pylons import c, g, request
10-from webob import Request
6+from pylons import c
117 from ming.orm.ormsession import ThreadLocalORMSession
128
139 from allura import model as M
14-from allura.lib.app_globals import Globals
1510 from allura.lib import helpers as h
11+from allura.tests import decorators as td
1612 from alluratest.controller import setup_basic_test, setup_global_objects
1713
1814
1915 def setUp():
2016 setup_basic_test()
17+ setup_with_tools()
18+
19+@td.with_wiki
20+def setup_with_tools():
2121 setup_global_objects()
2222
2323 @with_setup(setUp)
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -3,11 +3,12 @@ from urllib import quote
33 from nose.tools import with_setup, assert_equal
44 from pylons import g, c
55
6-from ming.orm import session, ThreadLocalORMSession
6+from ming.orm import ThreadLocalORMSession
77 from alluratest.controller import setup_basic_test, setup_global_objects
88
99 from allura import model as M
1010 from allura.lib import helpers as h
11+from allura.tests import decorators as td
1112
1213 from forgewiki import model as WM
1314 from forgeblog import model as BM
@@ -16,8 +17,13 @@ from forgeblog import model as BM
1617 def setUp():
1718 """Method called by nose before running each test"""
1819 setup_basic_test()
20+ setup_with_tools()
21+
22+@td.with_wiki
23+def setup_with_tools():
1924 setup_global_objects()
2025
26+@td.with_wiki
2127 def test_app_globals():
2228 g.oid_session()
2329 g.oid_session()
--- a/Allura/allura/tests/test_helpers.py
+++ b/Allura/allura/tests/test_helpers.py
@@ -1,14 +1,11 @@
1-from os import path, environ
1+from os import path
22
3-from tg import config
4-from pylons import c, g
5-from paste.deploy import loadapp
6-from paste.script.appinstall import SetupCommand
3+from pylons import c
74 from nose.tools import eq_, assert_equals
85
96 from allura import model as M
107 from allura.lib import helpers as h
11-
8+from allura.tests import decorators as td
129 from alluratest.controller import setup_basic_test
1310
1411
@@ -51,6 +48,7 @@ def test_make_roles():
5148 pr = u.project_role()
5249 assert h.make_roles([pr._id]).next() == pr
5350
51+@td.with_wiki
5452 def test_context_setters():
5553 h.set_context('test', 'wiki', neighborhood='Projects')
5654 assert c.project is not None
--- a/Allura/allura/tests/test_mail_util.py
+++ b/Allura/allura/tests/test_mail_util.py
@@ -2,10 +2,7 @@
22 import unittest
33 from email.MIMEMultipart import MIMEMultipart
44 from email.MIMEText import MIMEText
5-from email import header
6-from email.parser import Parser
75
8-import tg
96 from nose.tools import raises, assert_equal
107 from ming.orm import ThreadLocalORMSession
118
@@ -14,7 +11,7 @@ from allura.lib.utils import ConfigProxy
1411
1512 from allura.lib.mail_util import parse_address, parse_message
1613 from allura.lib.exceptions import AddressException
17-from allura.tasks.mail_tasks import route_email
14+from allura.tests import decorators as td
1815
1916 config = ConfigProxy(
2017 common_suffix='forgemail.domain',
@@ -44,6 +41,7 @@ class TestReactor(unittest.TestCase):
4441 def test_parse_address_bad_tool(self):
4542 parse_address('foo@hammer.test.p' + config.common_suffix)
4643
44+ @td.with_wiki
4745 def test_parse_address_good(self):
4846 topic, project, app = parse_address('foo@wiki.test.p' + config.common_suffix)
4947 assert_equal(topic, 'foo')
--- a/Allura/allura/tests/test_security.py
+++ b/Allura/allura/tests/test_security.py
@@ -1,21 +1,18 @@
1-from unittest import TestCase
2-from allura import model as M
3-from allura.lib import plugin
4-
1+from allura.tests import decorators as td
52 from allura.tests import TestController
63
7-from alluratest.controller import setup_basic_test, setup_unit_test
8-
94 class TestSecurity(TestController):
105
116 validate_skip = True
127
8+ @td.with_wiki
139 def test_anon(self):
1410 self.app.get('/security/*anonymous/forbidden', status=302)
1511 self.app.get('/security/*anonymous/needs_auth', status=302)
1612 self.app.get('/security/*anonymous/needs_project_access_fail', status=302)
1713 self.app.get('/security/*anonymous/needs_artifact_access_fail', status=302)
1814
15+ @td.with_wiki
1916 def test_auth(self):
2017 self.app.get('/security/test-admin/forbidden', status=403)
2118 self.app.get('/security/test-admin/needs_auth', status=200)
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -17,6 +17,7 @@ from allura.tasks import index_tasks
1717 from allura.tasks import mail_tasks
1818 from allura.tasks import notification_tasks
1919 from allura.tasks import repo_tasks
20+from allura.tests import decorators as td
2021 from allura.lib.decorators import event_handler, task
2122
2223 class TestEventTasks(unittest.TestCase):
@@ -45,6 +46,7 @@ class TestIndexTasks(unittest.TestCase):
4546 setup_basic_test()
4647 setup_global_objects()
4748
49+ @td.with_wiki
4850 def test_add_artifacts(self):
4951 old_shortlinks = M.Shortlink.query.find().count()
5052 old_solr_size = len(g.solr.db)
@@ -65,6 +67,7 @@ class TestIndexTasks(unittest.TestCase):
6567 a = _TestArtifact.query.get(_shorthand_id='t3')
6668 assert len(a.backrefs) == 5, a.backrefs
6769
70+ @td.with_wiki
6871 def test_del_artifacts(self):
6972 old_shortlinks = M.Shortlink.query.find().count()
7073 old_solr_size = len(g.solr.db)
@@ -114,6 +117,7 @@ class TestMailTasks(unittest.TestCase):
114117 assert args[5] == None
115118 assert 'This is a test' in str(args[6]), str(args[6])
116119
120+ @td.with_wiki
117121 def test_receive_email_ok(self):
118122 c.user = M.User.by_username('test-admin')
119123 import forgewiki
@@ -143,7 +147,10 @@ class TestRepoTasks(unittest.TestCase):
143147
144148 def setUp(self):
145149 setup_basic_test()
146- setup_global_objects()
150+ self.setup_with_tools()
151+
152+ @td.with_svn
153+ def setup_with_tools(self):
147154 h.set_context('test', 'src', neighborhood='Projects')
148155
149156 def test_init(self):
--- a/Allura/allura/websetup/bootstrap.py
+++ b/Allura/allura/websetup/bootstrap.py
@@ -138,42 +138,23 @@ def bootstrap(command, conf, vars):
138138 # TODO: Hope that Ming can be improved to at least avoid stuff below
139139 sess.flush(x)
140140
141-
142- log.info('Registering initial apps')
143-
144141 c.project = p0
145142 c.user = u_admin
146143 p1 = p0.new_subproject('sub1')
147144 ThreadLocalORMSession.flush_all()
148145 if asbool(conf.get('load_test_data')):
149- u_proj = M.Project.query.get(shortname='u/test-admin', neighborhood_id=n_users._id)
150- app = p0.install_app('SVN', 'src', 'SVN')
151- app = p0.install_app('Git', 'src-git', 'Git')
152- app.config.options['type'] = 'git'
153- app = p0.install_app('Hg', 'src-hg', 'Mercurial')
154- app.config.options['type'] = 'hg'
155- p0.install_app('Wiki', 'wiki')
156- p1.install_app('Wiki', 'wiki')
157- p0.install_app('Tickets', 'bugs')
158- app = p0.install_app('Tickets', 'doc-bugs')
159- role_anon = M.ProjectRole.by_name('*anonymous')._id
160- app.config.acl.append(M.ACE.allow(role_anon, 'post'))
161- app.config.acl.append(M.ACE.allow(role_anon, 'write'))
162- p0.install_app('Discussion', 'discussion')
163- p0.install_app('Link', 'link')
164- ThreadLocalORMSession.flush_all()
165- ThreadLocalORMSession.close_all()
166146 if asbool(conf.get('cache_test_data')):
167147 cache_test_data()
168148 else: # pragma no cover
169149 # regular first-time setup
170150 p0.add_user(u_admin, ['Admin'])
151+ log.info('Registering initial apps')
171152 for ep_name, app in g.entry_points['tool'].iteritems():
172153 if not app.installable:
173154 continue
174155 p0.install_app(ep_name)
175- ThreadLocalORMSession.flush_all()
176- ThreadLocalORMSession.close_all()
156+ ThreadLocalORMSession.flush_all()
157+ ThreadLocalORMSession.close_all()
177158
178159 def wipe_database():
179160 conn = M.main_doc_session.bind.conn
--- a/ForgeDiscussion/forgediscussion/tests/test_forum_roles.py
+++ b/ForgeDiscussion/forgediscussion/tests/test_forum_roles.py
@@ -1,14 +1,15 @@
1-from pylons import c, g
1+from pylons import c
22
33 from alluratest.controller import setup_basic_test, setup_global_objects
44 from allura import model as M
55 from allura.lib import security
6+from allura.tests import decorators as td
67
78 def setUp():
89 setup_basic_test()
910 setup_global_objects()
10- g.set_app('discussion')
1111
12+@td.with_discussion
1213 def test_role_assignments():
1314 admin = M.User.by_username('test-admin')
1415 user = M.User.by_username('test-user')
--- a/ForgeDownloads/forgedownloads/tests/functional/test_root.py
+++ b/ForgeDownloads/forgedownloads/tests/functional/test_root.py
@@ -1,7 +1,8 @@
11 from alluratest.controller import TestController
2-
2+from allura.tests import decorators as td
33
44 class TestRootController(TestController):
5+ @td.with_wiki
56 def test_root(self):
67 response = self.app.get('/downloads/nav.json')
78 root = self.app.get('/p/test/wiki/').follow()
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -11,12 +11,17 @@ from datadiff.tools import assert_equal
1111
1212 from allura import model as M
1313 from allura.lib import helpers as h
14+from allura.tests import decorators as td
1415 from alluratest.controller import TestController
1516
1617 class TestRootController(TestController):
1718
1819 def setUp(self):
1920 TestController.setUp(self)
21+ self.setup_with_tools()
22+
23+ @td.with_git
24+ def setup_with_tools(self):
2025 h.set_context('test', 'src-git', neighborhood='Projects')
2126 repo_dir = pkg_resources.resource_filename(
2227 'forgegit', 'tests/data')
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -11,6 +11,7 @@ from ming.orm import ThreadLocalORMSession
1111
1212 from alluratest.controller import setup_basic_test, setup_global_objects
1313 from allura.lib import helpers as h
14+from allura.tests import decorators as td
1415 from allura import model as M
1516 from forgegit import model as GM
1617 from forgewiki import model as WM
@@ -19,6 +20,11 @@ class TestNewGit(unittest.TestCase):
1920
2021 def setUp(self):
2122 setup_basic_test()
23+ self.setup_with_tools()
24+
25+ @td.with_git
26+ @td.with_wiki
27+ def setup_with_tools(self):
2228 setup_global_objects()
2329 h.set_context('test', 'src-git', neighborhood='Projects')
2430 repo_dir = pkg_resources.resource_filename(
@@ -26,7 +32,7 @@ class TestNewGit(unittest.TestCase):
2632 c.app.repo.fs_path = repo_dir
2733 c.app.repo.name = 'testgit.git'
2834 self.repo = c.app.repo
29- # self.repo = GM.Repository(
35+ #self.repo = GM.Repository(
3036 # name='testgit.git',
3137 # fs_path=repo_dir,
3238 # url_path = '/test/',
@@ -88,6 +94,10 @@ class TestGitRepo(unittest.TestCase):
8894
8995 def setUp(self):
9096 setup_basic_test()
97+ self.setup_with_tools()
98+
99+ @td.with_git
100+ def setup_with_tools(self):
91101 setup_global_objects()
92102 h.set_context('test', 'src-git', neighborhood='Projects')
93103 repo_dir = pkg_resources.resource_filename(
@@ -150,8 +160,12 @@ class TestGitCommit(unittest.TestCase):
150160
151161 def setUp(self):
152162 setup_basic_test()
163+ self.setup_with_tools()
164+
165+ @td.with_git
166+ def setup_with_tools(self):
153167 setup_global_objects()
154- h.set_context('test', 'src', neighborhood='Projects')
168+ h.set_context('test', 'src-git', neighborhood='Projects')
155169 repo_dir = pkg_resources.resource_filename(
156170 'forgegit', 'tests/data')
157171 self.repo = GM.Repository(
--- a/ForgeGit/forgegit/tests/test_git_app.py
+++ b/ForgeGit/forgegit/tests/test_git_app.py
@@ -1,17 +1,21 @@
11 import unittest
22 from nose.tools import assert_equals
33
4-from pylons import c, g
4+from pylons import c
55 from ming.orm import ThreadLocalORMSession
66
77 from alluratest.controller import setup_basic_test, setup_global_objects
88 from allura.lib import helpers as h
9-
9+from allura.tests import decorators as td
1010
1111 class TestGitApp(unittest.TestCase):
1212
1313 def setUp(self):
1414 setup_basic_test()
15+ self.setup_with_tools()
16+
17+ @td.with_git
18+ def setup_with_tools(self):
1519 setup_global_objects()
1620 h.set_context('test', 'src-git', neighborhood='Projects')
1721 ThreadLocalORMSession.flush_all()
@@ -21,8 +25,9 @@ class TestGitApp(unittest.TestCase):
2125 assert_equals(len(c.app.admin_menu()), 4)
2226
2327 def test_uninstall(self):
24- c.app.uninstall(c.project)
2528 from allura import model as M
29+ M.MonQTask.run_ready()
30+ c.app.uninstall(c.project)
2631 M.main_orm_session.flush()
2732 task = M.MonQTask.get()
2833 assert task.task_name == 'allura.tasks.repo_tasks.uninstall', task.task_name
--- a/ForgeGit/forgegit/tests/test_tasks.py
+++ b/ForgeGit/forgegit/tests/test_tasks.py
@@ -5,11 +5,16 @@ from ming.orm import ThreadLocalORMSession
55 from alluratest.controller import setup_basic_test, setup_global_objects
66 from allura.lib import helpers as h
77 from allura.tasks import repo_tasks
8+from allura.tests import decorators as td
89
910 class TestGitTasks(unittest.TestCase):
1011
1112 def setUp(self):
1213 setup_basic_test()
14+ self.setup_with_tools()
15+
16+ @td.with_git
17+ def setup_with_tools(self):
1318 setup_global_objects()
1419 h.set_context('test', 'src-git', neighborhood='Projects')
1520 ThreadLocalORMSession.flush_all()
--- a/ForgeHg/forgehg/tests/functional/test_controllers.py
+++ b/ForgeHg/forgehg/tests/functional/test_controllers.py
@@ -1,4 +1,3 @@
1-import os
21 import json
32
43 import pkg_resources
@@ -7,6 +6,7 @@ from ming.orm import ThreadLocalORMSession
76 from datadiff.tools import assert_equal
87
98 from allura.lib import helpers as h
9+from allura.tests import decorators as td
1010 from allura import model as M
1111 from alluratest.controller import TestController
1212
@@ -15,6 +15,10 @@ class TestRootController(TestController):
1515
1616 def setUp(self):
1717 TestController.setUp(self)
18+ self.setup_with_tools()
19+
20+ @td.with_hg
21+ def setup_with_tools(self):
1822 h.set_context('test', 'src-hg', neighborhood='Projects')
1923 repo_dir = pkg_resources.resource_filename(
2024 'forgehg', 'tests/data')
--- a/ForgeHg/forgehg/tests/model/test_repository.py
+++ b/ForgeHg/forgehg/tests/model/test_repository.py
@@ -7,6 +7,7 @@ from ming.orm import ThreadLocalORMSession
77
88 from alluratest.controller import setup_basic_test, setup_global_objects
99 from allura.lib import helpers as h
10+from allura.tests import decorators as td
1011 from allura import model as M
1112 from forgehg import model as HM
1213
@@ -14,8 +15,12 @@ class TestNewRepo(unittest.TestCase):
1415
1516 def setUp(self):
1617 setup_basic_test()
18+ self.setup_with_tools()
19+
20+ @td.with_hg
21+ def setup_with_tools(self):
1722 setup_global_objects()
18- h.set_context('test', 'src', neighborhood='Projects')
23+ h.set_context('test', 'src-hg', neighborhood='Projects')
1924 repo_dir = pkg_resources.resource_filename(
2025 'forgehg', 'tests/data')
2126 self.repo = HM.Repository(
@@ -50,7 +55,7 @@ class TestNewRepo(unittest.TestCase):
5055 assert self.rev.shorthand_id() == '[1c7eb5]'
5156 assert self.rev.symbolic_ids == (['default'], ['tip'])
5257 assert self.rev.url() == (
53- '/p/test/src/ci/'
58+ '/p/test/src-hg/ci/'
5459 '1c7eb55bbd66ff45906b4a25d4b403899e0ffff1/')
5560 all_cis = self.rev.log(0, 1000)
5661 assert len(all_cis) == 5
@@ -65,7 +70,7 @@ class TestNewRepo(unittest.TestCase):
6570 'README', '<pre>This is readme\nAnother line\n</pre>')
6671 assert self.rev.tree.path() == '/'
6772 assert self.rev.tree.url() == (
68- '/p/test/src/ci/'
73+ '/p/test/src-hg/ci/'
6974 '1c7eb55bbd66ff45906b4a25d4b403899e0ffff1/'
7075 'tree/')
7176 self.rev.tree.by_name['README']
@@ -75,6 +80,10 @@ class TestHgRepo(unittest.TestCase):
7580
7681 def setUp(self):
7782 setup_basic_test()
83+ self.setup_with_tools()
84+
85+ @td.with_hg
86+ def setup_with_tools(self):
7887 setup_global_objects()
7988 h.set_context('test', 'src-hg', neighborhood='Projects')
8089 repo_dir = pkg_resources.resource_filename(
@@ -138,6 +147,10 @@ class TestHgCommit(unittest.TestCase):
138147
139148 def setUp(self):
140149 setup_basic_test()
150+ self.setup_with_tools()
151+
152+ @td.with_hg
153+ def setup_with_tools(self):
141154 setup_global_objects()
142155 h.set_context('test', 'src-hg', neighborhood='Projects')
143156 repo_dir = pkg_resources.resource_filename(
--- a/ForgeHg/forgehg/tests/test_hg_app.py
+++ b/ForgeHg/forgehg/tests/test_hg_app.py
@@ -6,12 +6,16 @@ from ming.orm import ThreadLocalORMSession
66
77 from alluratest.controller import setup_basic_test, setup_global_objects
88 from allura.lib import helpers as h
9-
9+from allura.tests import decorators as td
1010
1111 class TestHgApp(unittest.TestCase):
1212
1313 def setUp(self):
1414 setup_basic_test()
15+ self.setup_with_tools()
16+
17+ @td.with_hg
18+ def setup_with_tools(self):
1519 setup_global_objects()
1620 h.set_context('test', 'src-hg', neighborhood='Projects')
1721 ThreadLocalORMSession.flush_all()
@@ -21,8 +25,9 @@ class TestHgApp(unittest.TestCase):
2125 assert_equals(len(c.app.admin_menu()), 4)
2226
2327 def test_uninstall(self):
24- c.app.uninstall(c.project)
2528 from allura import model as M
29+ M.MonQTask.run_ready()
30+ c.app.uninstall(c.project)
2631 M.main_orm_session.flush()
2732 task = M.MonQTask.get()
2833 assert task.task_name == 'allura.tasks.repo_tasks.uninstall', task.task_name
--- a/ForgeHg/forgehg/tests/test_tasks.py
+++ b/ForgeHg/forgehg/tests/test_tasks.py
@@ -1,17 +1,20 @@
11 import unittest
22
3-from pylons import c, g
4-
53 from ming.orm import ThreadLocalORMSession
64
75 from alluratest.controller import setup_basic_test, setup_global_objects
86 from allura.lib import helpers as h
97 from allura.tasks import repo_tasks
8+from allura.tests import decorators as td
109
1110 class TestHgReactors(unittest.TestCase):
1211
1312 def setUp(self):
1413 setup_basic_test()
14+ self.setup_with_tools()
15+
16+ @td.with_hg
17+ def setup_with_tools(self):
1518 setup_global_objects()
1619 h.set_context('test', 'src-hg', neighborhood='Projects')
1720 ThreadLocalORMSession.flush_all()
--- a/ForgeLink/forgelink/tests/functional/test_root.py
+++ b/ForgeLink/forgelink/tests/functional/test_root.py
@@ -1,9 +1,5 @@
1-import allura
2-
1+from allura.tests import decorators as td
32 from alluratest.controller import TestController
4-from allura.lib import helpers as h
5-from allura.ext.search import search_main
6-from ming.orm.ormsession import ThreadLocalORMSession
73
84
95 class TestRootController(TestController):
@@ -11,6 +7,7 @@ class TestRootController(TestController):
117 response = self.app.get('/link/index')
128 assert 'Link is not configured' in response
139
10+ @td.with_link
1411 def test_root_index_with_url(self):
1512 response = self.app.get('/admin/link/options', validate_chunk=True)
1613 response.form['url'] = 'http://www.google.com/'
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -1,4 +1,3 @@
1-import os
21 import json
32
43 import pkg_resources
@@ -7,9 +6,9 @@ pylons.c = pylons.tmpl_context
76 pylons.g = pylons.app_globals
87 from pylons import c
98 from ming.orm import ThreadLocalORMSession
10-from datadiff.tools import assert_equal
119
1210 from allura.lib import helpers as h
11+from allura.tests import decorators as td
1312 from alluratest.controller import TestController
1413
1514
@@ -17,6 +16,10 @@ class TestRootController(TestController):
1716
1817 def setUp(self):
1918 TestController.setUp(self)
19+ self.setup_with_tools()
20+
21+ @td.with_svn
22+ def setup_with_tools(self):
2023 h.set_context('test', 'src', neighborhood='Projects')
2124 repo_dir = pkg_resources.resource_filename(
2225 'forgesvn', 'tests/data/')
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -7,6 +7,7 @@ from ming.orm import ThreadLocalORMSession
77
88 from alluratest.controller import setup_basic_test, setup_global_objects
99 from allura.lib import helpers as h
10+from allura.tests import decorators as td
1011 from allura import model as M
1112 from forgesvn import model as SM
1213
@@ -14,6 +15,10 @@ class TestNewRepo(unittest.TestCase):
1415
1516 def setUp(self):
1617 setup_basic_test()
18+ self.setup_with_tools()
19+
20+ @td.with_svn
21+ def setup_with_tools(self):
1722 setup_global_objects()
1823 h.set_context('test', 'src', neighborhood='Projects')
1924 repo_dir = pkg_resources.resource_filename(
@@ -64,7 +69,12 @@ class TestSVNRepo(unittest.TestCase):
6469
6570 def setUp(self):
6671 setup_basic_test()
72+ self.setup_with_tools()
73+
74+ @td.with_svn
75+ def setup_with_tools(self):
6776 setup_global_objects()
77+ h.set_context('test', 'src', neighborhood='Projects')
6878 repo_dir = pkg_resources.resource_filename(
6979 'forgesvn', 'tests/data/')
7080 self.repo = SM.Repository(
@@ -128,6 +138,10 @@ class TestSVNRev(unittest.TestCase):
128138
129139 def setUp(self):
130140 setup_basic_test()
141+ self.setup_with_tools()
142+
143+ @td.with_svn
144+ def setup_with_tools(self):
131145 setup_global_objects()
132146 h.set_context('test', 'src', neighborhood='Projects')
133147 repo_dir = pkg_resources.resource_filename(
@@ -159,5 +173,3 @@ class TestSVNRev(unittest.TestCase):
159173 +self.rev.diffs.copied)
160174 for d in diffs:
161175 print d
162-
163-
--- a/ForgeSVN/forgesvn/tests/test_svn_app.py
+++ b/ForgeSVN/forgesvn/tests/test_svn_app.py
@@ -1,21 +1,21 @@
1-import os
2-import shutil
31 import unittest
4-import pkg_resources
52 from nose.tools import assert_equals
63
7-from pylons import c, g
4+from pylons import c
85 from ming.orm import ThreadLocalORMSession
96
107 from alluratest.controller import setup_basic_test, setup_global_objects
118 from allura.lib import helpers as h
12-from forgesvn import model as SM
13-
9+from allura.tests import decorators as td
1410
1511 class TestSVNApp(unittest.TestCase):
1612
1713 def setUp(self):
1814 setup_basic_test()
15+ self.setup_with_tools()
16+
17+ @td.with_svn
18+ def setup_with_tools(self):
1919 setup_global_objects()
2020 h.set_context('test', 'src', neighborhood='Projects')
2121 ThreadLocalORMSession.flush_all()
@@ -26,8 +26,9 @@ class TestSVNApp(unittest.TestCase):
2626 assert_equals(c.app.admin_menu()[0].label, 'Checkout URL')
2727
2828 def test_uninstall(self):
29- c.app.uninstall(c.project)
3029 from allura import model as M
30+ M.MonQTask.run_ready()
31+ c.app.uninstall(c.project)
3132 M.main_orm_session.flush()
3233 task = M.MonQTask.get()
3334 assert task.task_name == 'allura.tasks.repo_tasks.uninstall', task.task_name
--- a/ForgeTracker/forgetracker/tests/functional/test_import.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_import.py
@@ -7,13 +7,13 @@ import ming
77 import pylons
88 pylons.c = pylons.tmpl_context
99 pylons.g = pylons.app_globals
10-from pylons import c, g
10+from pylons import g
1111
1212 from allura import model as M
13-from alluratest.controller import TestController, TestRestApiBase
13+from alluratest.controller import TestRestApiBase
14+from allura.tests import decorators as td
1415
15-
16-class TestImportController(TestRestApiBase):#TestController):
16+class TestImportController(TestRestApiBase):
1717
1818 def new_ticket(self, mount_point='/bugs/', **kw):
1919 response = self.app.get(mount_point + 'new/')
@@ -32,7 +32,7 @@ class TestImportController(TestRestApiBase):#TestController):
3232 ming.orm.session(api_ticket).flush()
3333 self.set_api_token(api_ticket)
3434
35-
35+ @td.with_tracker
3636 def test_no_capability(self):
3737 here_dir = os.path.dirname(__file__)
3838
@@ -66,6 +66,7 @@ class TestImportController(TestRestApiBase):#TestController):
6666 assert_equal(from_api['custom_fields']['_cc'], org['cc'])
6767 assert_equal(from_api['custom_fields']['_private'], org['private'])
6868
69+ @td.with_tracker
6970 def test_validate_import(self):
7071 here_dir = os.path.dirname(__file__)
7172 doc_text = open(here_dir + '/data/sf.json').read()
@@ -73,6 +74,7 @@ class TestImportController(TestRestApiBase):#TestController):
7374 doc=doc_text, options='{}')
7475 assert not r.json['errors']
7576
77+ @td.with_tracker
7678 def test_import(self):
7779 here_dir = os.path.dirname(__file__)
7880 api_ticket = M.ApiTicket(user_id=self.user._id, capabilities={'import': ['Projects','test']},
--- a/ForgeTracker/forgetracker/tests/functional/test_rest.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_rest.py
@@ -2,18 +2,20 @@ import pylons
22 pylons.c = pylons.tmpl_context
33 pylons.g = pylons.app_globals
44 from pylons import c
5-from ming.orm import session
65
7-from allura import model as M
86 from allura.lib import helpers as h
9-from alluratest.controller import TestController, TestRestApiBase
10-from forgetracker import model as TM
7+from allura.tests import decorators as td
8+from alluratest.controller import TestRestApiBase
119
1210
1311 class TestTrackerApiBase(TestRestApiBase):
1412
1513 def setUp(self):
1614 super(TestTrackerApiBase, self).setUp()
15+ self.setup_with_tools()
16+
17+ @td.with_tracker
18+ def setup_with_tools(self):
1719 h.set_context('test', 'bugs', neighborhood='Projects')
1820 self.tracker_globals = c.app.globals
1921
@@ -108,6 +110,3 @@ class TestRestDiscussion(TestTrackerApiBase):
108110 assert reply.json['post']['text'] == 'This is a reply', reply.json
109111 thread = self.api_post('/rest/p/test/bugs/_discuss/thread/%s/' % discussion['threads'][0]['_id'])
110112 assert len(thread.json['thread']['posts']) == 2, thread.json
111-
112-
113-
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -4,18 +4,27 @@ import Image, StringIO
44 import allura
55
66 from mock import patch
7-from nose.tools import assert_true, assert_false, eq_, assert_equal
7+from nose.tools import assert_true, assert_false, assert_equal
88 from formencode.variabledecode import variable_encode
99
10-from alluratest.controller import TestController, REGISTRY
10+from alluratest.controller import TestController
1111 from allura import model as M
1212 from forgewiki import model as wm
1313 from forgetracker import model as tm
1414
1515 from allura.lib import helpers as h
16+from allura.tests import decorators as td
1617 from ming.orm.ormsession import ThreadLocalORMSession
1718
1819 class TrackerTestController(TestController):
20+ def setUp(self):
21+ super(TrackerTestController, self).setUp()
22+ self.setup_with_tools()
23+
24+ @td.with_tracker
25+ def setup_with_tools(self):
26+ pass
27+
1928 def new_ticket(self, mount_point='/bugs/', **kw):
2029 response = self.app.get(mount_point + 'new/')
2130 form = response.forms[1]
@@ -118,6 +127,7 @@ class TestFunctionalController(TrackerTestController):
118127 r = self.app.get('/p/test/bugs/feed.atom')
119128 assert 'Private Ticket' not in r
120129
130+ @td.with_tool('test', 'Tickets', 'doc-bugs')
121131 def test_two_trackers(self):
122132 summary = 'test two trackers'
123133 ticket_view = self.new_ticket('/doc-bugs/', summary=summary, _milestone='1.0').follow()
@@ -766,6 +776,11 @@ class TestMilestoneAdmin(TrackerTestController):
766776 assert tm.Ticket.query.find({
767777 'custom_fields._releases': '1.1'}).count() == 1
768778
779+def post_install_hook(app):
780+ role_anon = M.ProjectRole.by_name('*anonymous')._id
781+ app.config.acl.append(M.ACE.allow(role_anon, 'post'))
782+ app.config.acl.append(M.ACE.allow(role_anon, 'write'))
783+
769784 class TestEmailMonitoring(TrackerTestController):
770785 def __init__(self):
771786 super(TestEmailMonitoring, self).__init__()
@@ -786,6 +801,7 @@ class TestEmailMonitoring(TrackerTestController):
786801 assert email[0]['value'] == self.test_email
787802 assert mtype[0]['selected'] == 'selected'
788803
804+ @td.with_tool('test', 'Tickets', 'doc-bugs', post_install_hook=post_install_hook)
789805 @patch('forgetracker.model.ticket.Notification.send_direct')
790806 def test_notifications_moderators(self, send_direct):
791807 self.new_ticket(summary='test moderation', mount_point='/doc-bugs/')
--- a/ForgeTracker/forgetracker/tests/test_controller.py
+++ b/ForgeTracker/forgetracker/tests/test_controller.py
@@ -1,9 +1,11 @@
11 from nose.tools import assert_true
22
3+from allura.tests import decorators as td
34 from alluratest.controller import TestController
45
56
67 class TestRootController(TestController):
8+ @td.with_tracker
79 def test_index(self):
810 response = self.app.get('/bugs/')
911 assert_true('bugs' in response)
--- a/ForgeTracker/forgetracker/tests/test_tracker_roles.py
+++ b/ForgeTracker/forgetracker/tests/test_tracker_roles.py
@@ -3,9 +3,14 @@ from pylons import c, g
33 from alluratest.controller import setup_basic_test, setup_global_objects
44 from allura import model as M
55 from allura.lib import security
6+from allura.tests import decorators as td
67
78 def setUp():
89 setup_basic_test()
10+ setup_with_tools()
11+
12+@td.with_tracker
13+def setup_with_tools():
914 setup_global_objects()
1015 g.set_app('bugs')
1116
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -9,6 +9,7 @@ from ming.orm.ormsession import ThreadLocalORMSession
99
1010 from allura import model as M
1111 from allura.lib import helpers as h
12+from allura.tests import decorators as td
1213 from alluratest.controller import TestController
1314
1415 from forgewiki import model
@@ -22,6 +23,14 @@ from forgewiki import model
2223 # reply, delete
2324
2425 class TestRootController(TestController):
26+ def setUp(self):
27+ super(TestRootController, self).setUp()
28+ self.setup_with_tools()
29+
30+ @td.with_wiki
31+ def setup_with_tools(self):
32+ pass
33+
2534 def test_root_index(self):
2635 r = self.app.get('/wiki/tést/').follow()
2736 assert 'tést' in r
--- a/ForgeWiki/forgewiki/tests/test_wiki_roles.py
+++ b/ForgeWiki/forgewiki/tests/test_wiki_roles.py
@@ -5,9 +5,14 @@ from nose.tools import assert_equal
55 from alluratest.controller import setup_basic_test, setup_global_objects
66 from allura import model as M
77 from allura.lib import security
8+from allura.tests import decorators as td
89
910 def setUp():
1011 setup_basic_test()
12+ setup_with_tools()
13+
14+@td.with_wiki
15+def setup_with_tools():
1116 setup_global_objects()
1217 g.set_app('wiki')
1318