Imported Upstream version 4.3.1
This commit is contained in:
@@ -17,16 +17,15 @@
|
||||
# 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 nose
|
||||
import ldap
|
||||
import pytest
|
||||
|
||||
from ipatests.test_ipaserver.httptest import Unauthorized_HTTP_test
|
||||
from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test
|
||||
from ipatests.util import assert_equal
|
||||
from ipatests.util import assert_equal, assert_not_equal
|
||||
from ipalib import api, errors
|
||||
from ipapython.dn import DN
|
||||
from ipapython.ipaldap import ldap_initialize
|
||||
|
||||
testuser = u'tuser'
|
||||
old_password = u'old_password'
|
||||
@@ -42,7 +41,7 @@ class test_changepw(XMLRPC_test, Unauthorized_HTTP_test):
|
||||
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:
|
||||
raise unittest.SkipTest(
|
||||
raise nose.SkipTest(
|
||||
'Cannot set up test user: %s' % e
|
||||
)
|
||||
|
||||
@@ -60,7 +59,7 @@ class test_changepw(XMLRPC_test, Unauthorized_HTTP_test):
|
||||
|
||||
def _checkpw(self, user, password):
|
||||
dn = str(DN(('uid', user), api.env.container_user, api.env.basedn))
|
||||
conn = ldap_initialize(api.env.ldap_uri)
|
||||
conn = ldap.initialize(api.env.ldap_uri)
|
||||
try:
|
||||
conn.simple_bind_s(dn, password)
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user