Commit 90e8ff7b authored by godog's avatar godog
Browse files

test: use bytes.hex()

parent 16f9c277
import codecs
import email
import imaplib
import os
......@@ -58,7 +57,7 @@ class TestMail(TestBase):
imap.login, 'foo@example.com', 'wrong password')
def _create_msg(self, sender, rcpt):
unique_id = codecs.encode(os.urandom(4), 'hex')
unique_id = os.urandom(4).hex()
msg = MIMEText('This is a test message, please ignore.')
msg['Subject'] = 'test message #%s' % unique_id
msg['X-UniqueID'] = unique_id
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment