Merge branch 'defect/619-fix-poplib-initialization' into 'master'
Fix kwargs for poplib.POP3_SSL and poplib.POP3 Closes #619 See merge request mayan-edms/mayan-edms!50
This commit is contained in:
@@ -277,10 +277,10 @@ class POP3Email(EmailBaseModel):
|
||||
logger.debug('ssl: %s', self.ssl)
|
||||
|
||||
if self.ssl:
|
||||
mailbox = poplib.POP3_SSL(host=self.host, post=self.port)
|
||||
mailbox = poplib.POP3_SSL(host=self.host, port=self.port)
|
||||
else:
|
||||
mailbox = poplib.POP3(
|
||||
host=self.host, post=self.port, timeout=self.timeout
|
||||
host=self.host, port=self.port, timeout=self.timeout
|
||||
)
|
||||
|
||||
mailbox.getwelcome()
|
||||
|
||||
@@ -217,7 +217,7 @@ class POP3SourceTestCase(GenericDocumentTestCase):
|
||||
def user(self, username):
|
||||
return
|
||||
|
||||
@mock.patch('poplib.POP3_SSL')
|
||||
@mock.patch('poplib.POP3_SSL', autospec=True)
|
||||
def test_download_document(self, mock_poplib):
|
||||
mock_poplib.return_value = POP3SourceTestCase.MockMailbox()
|
||||
self.source = POP3Email.objects.create(
|
||||
|
||||
Reference in New Issue
Block a user