Feature/update account tests (#3556)

* update account tests

* change second user

* refactoring

* clean

* fix tests email receiving

* fix
This commit is contained in:
ShahRustam
2020-06-11 16:02:38 +03:00
committed by GitHub
parent 266612bbdf
commit 405dcda824
2 changed files with 441 additions and 512 deletions

View File

@@ -79,7 +79,9 @@ def receive_email(): # pylint:disable=redefined-outer-name, too-many-locals
server.select("INBOX")
_, mails = server.search(None, "ALL")
for index in mails[0].split():
_, data = server.fetch(index, "(RFC822)")
status, data = server.fetch(index, "(RFC822)")
if status != "OK" or not data or not isinstance(data[0], tuple):
continue
msg = email.message_from_string(
data[0][1].decode("ASCII", errors="surrogateescape")
)