You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2020/06/03 16:05:23 UTC

[allura] 01/12: [#8361] templates tests pass

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

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

commit 03e2aac98d93de4c0911f72a09544a60f16219e1
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Fri May 8 17:10:14 2020 -0400

    [#8361] templates tests pass
---
 Allura/allura/controllers/auth.py                      |  2 ++
 Allura/allura/tests/templates/jinja_master/test_lib.py |  5 +++--
 AlluraTest/alluratest/controller.py                    | 12 ------------
 3 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 9573993..5c457b6 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -113,6 +113,8 @@ class AuthController(BaseController):
             self.disable = DisableAccountController()
 
     def __getattr__(self, name):
+        if name == 'decoration':
+            raise AttributeError("TG decoratedcontroller calls this during import time, can't do anything complex")
         urls = plugin.UserPreferencesProvider.get().additional_urls()
         if name not in urls:
             raise AttributeError("'%s' object has no attribute '%s'" % (type(self).__name__, name))
diff --git a/Allura/allura/tests/templates/jinja_master/test_lib.py b/Allura/allura/tests/templates/jinja_master/test_lib.py
index 8b27438..67c0571 100644
--- a/Allura/allura/tests/templates/jinja_master/test_lib.py
+++ b/Allura/allura/tests/templates/jinja_master/test_lib.py
@@ -21,8 +21,9 @@ from tg import config, app_globals as g
 from mock import Mock
 from nose.tools import assert_equal
 
+import ming
 from allura.config.app_cfg import ForgeConfig, AlluraJinjaRenderer
-from alluratest.controller import setup_config_test
+from alluratest.controller import setup_basic_test
 
 
 def strip_space(s):
@@ -31,7 +32,7 @@ def strip_space(s):
 
 class TemplateTest(object):
     def setUp(self):
-        setup_config_test()
+        setup_basic_test()
         self.jinja2_env = AlluraJinjaRenderer.create(config, g)['jinja'].jinja2_env
 
 
diff --git a/AlluraTest/alluratest/controller.py b/AlluraTest/alluratest/controller.py
index b5e53de..2da93da 100644
--- a/AlluraTest/alluratest/controller.py
+++ b/AlluraTest/alluratest/controller.py
@@ -76,18 +76,6 @@ def get_config_file(config=None, current_pkg=None):
         return conf_file
 
 
-def setup_config_test(config_file=None, force=False):
-    '''
-    This may be necessary to use within test setup that needs the app config loaded
-    '''
-    if not config_file:
-        config_file = get_config_file()
-    already_loaded = tg.config.get('tg.app_globals')
-    if not already_loaded or force:
-        loadapp('config:' + config_file)
-setup_config_test.__test__ = False
-
-
 def setup_basic_test(config=None, app_name=DFL_APP_NAME):
     '''
     Create clean environment for running tests, includes mongodb connection with "mim" (mongo-in-memory) and sample