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

gcruz 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 f837140cf [#8492] test fix for test_remove_no_index_tag_profile
f837140cf is described below

commit f837140cfbaaf73b8a1d655aa8bdebd877282db8
Author: Guillermo Cruz <[email protected]>
AuthorDate: Fri Jan 27 10:23:31 2023 -0600

    [#8492] test fix for test_remove_no_index_tag_profile
---
 Allura/allura/ext/user_profile/user_main.py         | 12 +++++++-----
 Allura/allura/tests/functional/test_user_profile.py |  5 ++---
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/Allura/allura/ext/user_profile/user_main.py 
b/Allura/allura/ext/user_profile/user_main.py
index 6df361c07..c9081618b 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -156,13 +156,15 @@ class UserProfileController(BaseController, 
FeedController):
                     for section in c.app.profile_sections]
 
         noindex = True
-        required_section = 2
-        count = 0
+        has_projects = False
+        has_timeline = False
         for s in sections:
             s.setup_context()
-            if s.context.get('timeline') or s.context.get('projects'):
-                count += 1
-        if count == required_section:
+            if s.context.get('projects'):
+                has_projects = True
+            if s.context.get('timeline'):
+                has_timeline = True
+        if has_projects and has_timeline:
             noindex = False
         return dict(
             user=user,
diff --git a/Allura/allura/tests/functional/test_user_profile.py 
b/Allura/allura/tests/functional/test_user_profile.py
index 76ec1dc9d..33502c783 100644
--- a/Allura/allura/tests/functional/test_user_profile.py
+++ b/Allura/allura/tests/functional/test_user_profile.py
@@ -271,10 +271,9 @@ class TestUserProfile(TestDiscussBase):
         r = self.app.get('/u/test-user/profile/')
         assert 'content="noindex, follow"' in r.text
 
-    @td.with_user_project('test-user')
     def test_remove_no_index_tag_profile(self):
-        self._make_post("New Post...", 'test-user')
-        r = self.app.get('/u/test-user/profile/')
+        self._make_post("New Post...", 'test-admin')
+        r = self.app.get('/u/test-admin/profile/')
         assert 'content="noindex, follow"' not in r.text
 
 

Reply via email to