mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Add tests to update Mailbox.last_polling
This commit is contained in:
parent
086bcd3acd
commit
e8bcd56727
1 changed files with 16 additions and 0 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
import os
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from django_mailbox.models import Mailbox
|
from django_mailbox.models import Mailbox
|
||||||
|
|
@ -18,3 +20,17 @@ class TestMailbox(TestCase):
|
||||||
expected_protocol,
|
expected_protocol,
|
||||||
actual_protocol,
|
actual_protocol,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_last_polling_field_exists(self):
|
||||||
|
mailbox = Mailbox()
|
||||||
|
self.assertTrue(hasattr(mailbox, 'last_polling'))
|
||||||
|
|
||||||
|
def test_get_new_mail_update_last_polling(self):
|
||||||
|
mailbox = Mailbox.objects.create(uri="mbox://" + os.path.join(
|
||||||
|
os.path.dirname(__file__),
|
||||||
|
'messages',
|
||||||
|
'generic_message.eml',
|
||||||
|
))
|
||||||
|
self.assertEqual(mailbox.last_polling, None)
|
||||||
|
mailbox.get_new_mail()
|
||||||
|
self.assertNotEqual(mailbox.last_polling, None)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue