mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Adding a more-versatile condition-handling method for preventing integration tests from mashing on one another.
This commit is contained in:
parent
3e1f6b9909
commit
988cb7504f
6 changed files with 17 additions and 17 deletions
|
|
@ -55,12 +55,12 @@ class EmailMessageTestCase(TestCase):
|
|||
settings.EMAIL_USE_TLS = True
|
||||
super(EmailMessageTestCase, self).setUp()
|
||||
|
||||
def _get_new_messages(self, mailbox):
|
||||
def _get_new_messages(self, mailbox, condition=None):
|
||||
maximum_wait = time.time() + self.maximum_wait_seconds
|
||||
while True:
|
||||
if time.time() > maximum_wait:
|
||||
raise EmailIntegrationTimeout()
|
||||
messages = self.mailbox.get_new_mail()
|
||||
messages = self.mailbox.get_new_mail(condition)
|
||||
if messages:
|
||||
return messages
|
||||
time.sleep(5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue