[PATCH 3 of 9 Registration cube] [py3] fix No module named 'urlparse'

Nsukami Patrick ptrck at nskm.xyz
Wed Apr 1 12:50:06 CEST 2020


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585673233 0
#      Tue Mar 31 16:47:13 2020 +0000
# Node ID 2fd5b562ef2283908c936130e800272df52d7d5a
# Parent  6ab69ed20fc6448790dd9298dfe951d5049f204e
[py3] fix No module named 'urlparse'

diff --git a/test/unittest_registration.py b/test/unittest_registration.py
--- a/test/unittest_registration.py
+++ b/test/unittest_registration.py
@@ -1,6 +1,6 @@
 import cgi
 import re
-import urlparse
+from urllib.parse import urlsplit
 from contextlib import contextmanager
 
 from cubicweb.crypto import encrypt, decrypt
@@ -83,7 +83,7 @@
             text = MAILBOX[-1].message.get_payload(decode=True)
             url = URL_RE.search(text).group(1)
             # ... and the registration key contains all data
-            key = dict(cgi.parse_qsl(urlparse.urlsplit(url)[3]))['key']
+            key = dict(cgi.parse_qsl(urlsplit(url)[3]))['key']
             d = self._posted_form('upassword-subject-confirm')
             self.assertDictEqual(decrypt(key, self.config['registration-cypher-seed']), d)
 




More information about the cubicweb-devel mailing list