def test_delete_user_in_backends_by_username(self):
        """ Delete a user previously registered user by username
        """
        # first, create a user and register it with services
        try:
            self.msu.create_user('bootsy', 'collins', 'funk@mothership.com')
        except NotImplementedError:
            skip("user management not supported in this version of managesf")
        self.logout()
        self.login('bootsy', 'collins', config.GATEWAY_URL)
        # make sure user is in redmine and gerrit
        self.assertEqual('funk@mothership.com',
                         self.gu.get_account('bootsy').get('email'))
        if has_issue_tracker():
            users = self.rm.active_users()
            users = [u for u in users if u[0] == 'bootsy']
            self.assertEqual(1, len(users))
            user = users[0]
            self.assertEqual('funk@mothership.com',
                             user[1])
        # now suppress it
        del_url = config.GATEWAY_URL + 'manage/services_users/?username=bootsy'
        # try with a a non-admin user, it should not work ...
        auth_cookie = get_cookie(config.GATEWAY_HOST,
                                 'user5', config.ADMIN_PASSWORD)
        d = requests.delete(del_url,
                            cookies={'auth_pubtkt': auth_cookie})
        self.assertEqual(401,
                         int(d.status_code))
        # try with an admin ...
        auth_cookie = config.USERS[config.ADMIN_USER]['auth_cookie']
        d = requests.delete(del_url,
                            cookies={'auth_pubtkt': auth_cookie})
        self.assertTrue(400 < int(d.status_code), d.status_code)
        # make sure the user does not exist anymore
        self.assertEqual(False,
                         self.gu.get_account('bootsy'))
        if has_issue_tracker():
            users = self.rm.active_users()
            self.assertEqual(0,
                             len([u for u in users
                                  if u[0] == 'bootsy']))
dataset/ETHPy150Open redhat-cip/software-factory/tests/functional/test_userdata.py/TestUserdata.test_delete_user_in_backends_by_username/swapped operands of `<`