forked from mirror/django-mailbox
Move the bulk get_new_mail to queryset
This commit is contained in:
parent
505bc8d1c9
commit
0c6f6aa6ce
3 changed files with 27 additions and 7 deletions
|
|
@ -34,3 +34,13 @@ class TestMailbox(TestCase):
|
|||
self.assertEqual(mailbox.last_polling, None)
|
||||
list(mailbox.get_new_mail())
|
||||
self.assertNotEqual(mailbox.last_polling, None)
|
||||
|
||||
def test_queryset_get_new_mail(self):
|
||||
mailbox = Mailbox.objects.create(uri="mbox://" + os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
'messages',
|
||||
'generic_message.eml',
|
||||
))
|
||||
Mailbox.objects.filter(pk=mailbox.pk).get_new_mail()
|
||||
mailbox.refresh_from_db()
|
||||
self.assertNotEqual(mailbox.last_polling, None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue