[PATCH 7 of 9 Registration cube] use parse_qsl from urllib.parse and no more from cgi

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


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585737815 0
#      Wed Apr 01 10:43:35 2020 +0000
# Node ID 1bd532f3da619c5be22bec4da455ed10e744bc50
# Parent  d80b6cbd9059bff853b474e4ffb320d65a8a7544
use parse_qsl from urllib.parse and no more from cgi

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,5 @@
-import cgi
 import re
-from urllib.parse import urlsplit
+from urllib.parse import urlsplit, parse_qsl
 from contextlib import contextmanager
 
 from cubicweb.crypto import encrypt, decrypt
@@ -83,7 +82,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(urlsplit(url)[3]))['key']
+            key = dict(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