• Jérome Perrin's avatar
    ERP5TypeTestCase: stop copying ZopeTestCase's publish implementation · 8d81b128
    Jérome Perrin authored
    Call the original method instead of copy/pasting the code
    
    The original method will use .encode() on the basic= argument, so it
    needs to be an ascii str or an unicode on python2, we had to change
    some callers to pass basic= as text, to prevent:
    
         File "eggs/Zope-4.5.3+slapospatched001-py2.7.egg/Testing/ZopeTestCase/functional.py", line 43, in wrapped_func
           return func(*args, **kw)
         File "eggs/Zope-4.5.3+slapospatched001-py2.7.egg/Testing/ZopeTestCase/functional.py", line 93, in publish
           env['HTTP_AUTHORIZATION'] = basic_auth_encode(basic)
         File "eggs/Zope-4.5.3+slapospatched001-py2.7.egg/ZPublisher/utils.py", line 91, in basic_auth_encode
           header = b'Basic ' + base64.b64encode(value.encode('latin-1'))
       UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in range(128)
    8d81b128
ERP5TypeTestCase.py 60.3 KB