From a812a43a2cde3e243f4b9c578cc0b6873142fb71 Mon Sep 17 00:00:00 2001 From: Evarin Date: Sat, 29 Sep 2018 23:58:32 +0200 Subject: [PATCH] Compatibilite des tests en py2 --- allauth_ens/tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/allauth_ens/tests.py b/allauth_ens/tests.py index fe3edc3..b902d81 100644 --- a/allauth_ens/tests.py +++ b/allauth_ens/tests.py @@ -166,13 +166,15 @@ class LongTermClipperTests(CASTestCase): def _setup_ldap(self, promo=12, username="test"): try: buid = six.binary_type(username, 'utf-8') + home = six.binary_type('/users/%d/phy/test/' % promo, 'utf-8') except TypeError: buid = six.binary_type(username) + home = six.binary_type('/users/%d/phy/test/' % promo) _mock_ldap.directory['dc=spi,dc=ens,dc=fr'] = { 'uid': [buid], 'cn': [b'John Smith'], 'mailRoutingAddress': [b'test@clipper.ens.fr'], - 'homeDirectory': [bytes('/users/%d/phy/test/' % promo)], + 'homeDirectory': [home], } def _count_ldap_queries(self):