diff --git a/django_mailbox/tests/test_mailbox.py b/django_mailbox/tests/test_mailbox.py index d06fc77..10fa904 100644 --- a/django_mailbox/tests/test_mailbox.py +++ b/django_mailbox/tests/test_mailbox.py @@ -1,3 +1,5 @@ +import os + from django.test import TestCase from django_mailbox.models import Mailbox @@ -18,3 +20,17 @@ class TestMailbox(TestCase): expected_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)