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

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

commit 6b06b7d0bd5e90caefe0c4bcfe46bd717a5a6e4b
Author: Dave Brondsema <[email protected]>
AuthorDate: Wed Jul 10 16:51:16 2024 -0400

    [#8566] make some tests run on their own (and in parallel) without error
---
 Allura/allura/tests/test_globals.py | 8 +++++---
 Allura/allura/tests/test_plugin.py  | 1 +
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Allura/allura/tests/test_globals.py 
b/Allura/allura/tests/test_globals.py
index ec2718da5..e3f9e10bf 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -765,6 +765,7 @@ class Test():
 class TestCachedMarkdown(unittest.TestCase):
 
     def setup_method(self, method):
+        setup()
         self.md = ForgeMarkdown()
         self.post = M.Post()
         self.post.text = '**bold**'
@@ -775,9 +776,10 @@ class TestCachedMarkdown(unittest.TestCase):
             self.md.cached_convert(self.post, 'no_such_field')
 
     def test_missing_cache_field(self):
-        delattr(self.post, 'text_cache')
-        html = self.md.cached_convert(self.post, 'text')
-        self.assertEqual(html, self.expected_html)
+        with h.push_context('test', 'wiki', neighborhood='Projects'):
+            delattr(self.post, 'text_cache')
+            html = self.md.cached_convert(self.post, 'text')
+            self.assertEqual(html, self.expected_html)
 
     @patch.dict('allura.lib.app_globals.config', 
markdown_cache_threshold='-0.01')
     def test_non_ascii(self):
diff --git a/Allura/allura/tests/test_plugin.py 
b/Allura/allura/tests/test_plugin.py
index 90e65ee1c..5bdaf5751 100644
--- a/Allura/allura/tests/test_plugin.py
+++ b/Allura/allura/tests/test_plugin.py
@@ -259,6 +259,7 @@ class TestProjectRegistrationProviderPhoneVerification:
                 assert result == g.phone_service.verify.return_value
             assert 2 == g.phone_service.verify.call_count
 
+    @patch('allura.lib.helpers.request', Request.blank('/'))
     @patch.object(plugin, 'g')
     def test_verify_phone_max_limit_reached(self, g):
         g.phone_service = Mock(spec=phone.PhoneService)

Reply via email to