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

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

commit 6874494864dbfa69eed7bf8bd369c8722d3c9389
Author: Dave Brondsema <[email protected]>
AuthorDate: Tue Mar 8 22:08:03 2022 +0000

    [#8391] update test case to use /remove_user endpoint.  Also re-use 
existing test since it does a lot of similar steps
---
 Allura/allura/tests/functional/test_admin.py | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/Allura/allura/tests/functional/test_admin.py 
b/Allura/allura/tests/functional/test_admin.py
index 1dbe6d1..3a300e8 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -666,29 +666,17 @@ class TestProjectAdmin(TestController):
                 user_id=uid, project_id=p._id, app_config_id=ac._id)
             assert sub, 'New admin not subscribed to app %s' % ac
 
-    def test_admin_unsubscriptions(self):
         """
         When user is removed from admins group then user must be unsubscribed
         from all the tools in the project
         """
-        r = self.app.get('/admin/groups/')
-        admin_holder = r.html.find(
-            'table', {'id': 'usergroup_admin'}).findAll('tr')[1]
-        admin_id = admin_holder['data-group']
-        with audits('add user test-user to Admin'):
-            self.app.post('/admin/groups/add_user', params={
-                'role_id': admin_id,
-                'username': 'test-user'})
-        p_nbhd = M.Neighborhood.query.get(name='Projects')
-        p = M.Project.query.get(shortname='test', neighborhood_id=p_nbhd._id)
-        uid = M.User.by_username('test-user')._id
+        self.app.post('/admin/groups/remove_user', params={
+            'role_id': admin_id,
+            'username': 'test-user'})
         for ac in p.app_configs:
-            M.Mailbox.unsubscribe(
-                user_id=uid, project_id=p._id, app_config_id=ac._id
-            )
             sub = M.Mailbox.subscribed(
                 user_id=uid, project_id=p._id, app_config_id=ac._id)
-        assert not sub, 'New admin not unsubscribed to app %s' % ac
+            assert not sub, 'New admin not unsubscribed to app %s' % ac
 
     def test_new_user_subscriptions(self):
         """Newly added user must not be subscribed to all the tools in the 
project if he is not admin"""

Reply via email to