Imported Debian patch 4.7.2-3

This commit is contained in:
Timo Aaltonen
2019-05-06 08:43:34 +03:00
committed by Mario Fetka
parent 27edeba051
commit 8bc559c5a1
917 changed files with 1068993 additions and 1184676 deletions

View File

@@ -17,6 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
import pytest
from ipatests.test_ipaserver.httptest import Unauthorized_HTTP_test
@@ -35,23 +37,20 @@ new_password = u'new_password'
class test_changepw(XMLRPC_test, Unauthorized_HTTP_test):
app_uri = '/ipa/session/change_password'
@pytest.fixture(autouse=True)
def changepw_setup(self, request):
def setup(self):
try:
api.Command['user_add'](uid=testuser, givenname=u'Test', sn=u'User')
api.Command['passwd'](testuser, password=u'old_password')
except errors.ExecutionError as e:
pytest.skip(
raise unittest.SkipTest(
'Cannot set up test user: %s' % e
)
def fin():
try:
api.Command['user_del']([testuser])
except errors.NotFound:
pass
request.addfinalizer(fin)
def teardown(self):
try:
api.Command['user_del']([testuser])
except errors.NotFound:
pass
def _changepw(self, user, old_password, new_password):
return self.send_request(params={'user': str(user),