1. Peter Sagerson
  2. django-auth-ldap

Pull requests

#9 Merged
Repository
roderik333
Branch
default
Repository
psagers
Branch
python3

Updated for Python3.x

Author
  1. Rune Hansen
Reviewers
Description

I've updated djang-auth-ldap for Python 3, possibly loosing backwards compatibility with python 2.5 along the way. On python 2.7.x, all tests passes. On python 3.3 there is one failure: FAIL: test_unicode_user (django_auth_ldap.tests.LDAPTest)


Traceback (most recent call last): File "/home/roderik/Documents/workspace/bweeksite/django-auth-ldap/test/django_auth_ldap/tests.py", line 791, in test_unicode_user self.assertTrue(user is not None) AssertionError: False is not true -- The error comes as a result of the "dressler" dict in the LDAPTest class. I haven't looked very hard at this. I think the test_unicode_user method needs some reworking to support both 2.x and 3.x.

While testing django-auth-ldap against my company's LDAP server I noticed that the LDAP options that I needed to set were being set on the initialized LDAP connection. In my case, this is too late - I need to pass in: AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT: ldap.OPT_X_TLS_NEVER, } on the ldap object, before initialization.

Hope this will be useful.

best regards Rune Hansen

  • Learn about pull requests

Comments (1)

  1. Peter Sagerson repo owner

    Thanks for the changes. Because this is a backwards-incompatible diff (it breaks support for Python 2.5 and adds a new dependency in Django < 1.5), it may require a major version rev or some other migration plan in order to release it.