mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-10 06:48:19 +02:00
adds updated module name
This commit is contained in:
parent
5177ea5c65
commit
d94faeeee7
50 changed files with 224 additions and 218 deletions
|
|
@ -5,8 +5,8 @@ import time
|
|||
from django.conf import settings
|
||||
from django.test import TestCase
|
||||
|
||||
from django_mailbox import models, utils
|
||||
from django_mailbox.models import Mailbox, Message
|
||||
from django_mailbox2 import models, utils
|
||||
from django_mailbox2.models import Mailbox, Message
|
||||
|
||||
|
||||
class EmailIntegrationTimeout(Exception):
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ DATABASES = {
|
|||
INSTALLED_APPS = [
|
||||
"django.contrib.auth",
|
||||
"django.contrib.contenttypes",
|
||||
"django_mailbox",
|
||||
"django_mailbox2",
|
||||
]
|
||||
SECRET_KEY = "beepboop"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ from urllib import parse
|
|||
|
||||
from django.core.mail import EmailMultiAlternatives
|
||||
|
||||
from django_mailbox.models import Mailbox
|
||||
from django_mailbox.tests.base import EmailMessageTestCase
|
||||
from django_mailbox2.models import Mailbox
|
||||
from django_mailbox2.tests.base import EmailMessageTestCase
|
||||
|
||||
|
||||
__all__ = ["TestImap"]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import os
|
|||
|
||||
from django.test import TestCase
|
||||
|
||||
from django_mailbox.models import Mailbox
|
||||
from django_mailbox2.models import Mailbox
|
||||
|
||||
|
||||
__all__ = ["TestMailbox"]
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import copy
|
|||
|
||||
from unittest import mock
|
||||
|
||||
from django_mailbox import models, utils
|
||||
from django_mailbox.models import Message
|
||||
from django_mailbox.tests.base import EmailMessageTestCase
|
||||
from django_mailbox2 import models, utils
|
||||
from django_mailbox2.models import Message
|
||||
from django_mailbox2.tests.base import EmailMessageTestCase
|
||||
|
||||
|
||||
__all__ = ["TestMessageFlattening"]
|
||||
|
|
@ -81,7 +81,7 @@ class TestMessageFlattening(EmailMessageTestCase):
|
|||
)
|
||||
default_settings = utils.get_settings()
|
||||
|
||||
with mock.patch("django_mailbox.utils.get_settings") as get_settings:
|
||||
with mock.patch("django_mailbox2.utils.get_settings") as get_settings:
|
||||
altered = copy.deepcopy(default_settings)
|
||||
altered["strip_unallowed_mimetypes"] = True
|
||||
altered["allowed_mimetypes"] = ["text/plain"]
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ import os.path
|
|||
import copy
|
||||
from unittest import mock
|
||||
|
||||
from django_mailbox.models import Mailbox, Message
|
||||
from django_mailbox.utils import convert_header_to_unicode
|
||||
from django_mailbox import utils
|
||||
from django_mailbox.tests.base import EmailMessageTestCase
|
||||
from django_mailbox2.models import Mailbox, Message
|
||||
from django_mailbox2.utils import convert_header_to_unicode
|
||||
from django_mailbox2 import utils
|
||||
from django_mailbox2.tests.base import EmailMessageTestCase
|
||||
from django.utils.encoding import force_str
|
||||
from django.core.mail import EmailMessage
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ class TestProcessEmail(EmailMessageTestCase):
|
|||
|
||||
default_settings = utils.get_settings()
|
||||
|
||||
with mock.patch("django_mailbox.utils.get_settings") as get_settings:
|
||||
with mock.patch("django_mailbox2.utils.get_settings") as get_settings:
|
||||
altered = copy.deepcopy(default_settings)
|
||||
altered["store_original_message"] = True
|
||||
get_settings.return_value = altered
|
||||
|
|
@ -377,7 +377,7 @@ class TestProcessEmail(EmailMessageTestCase):
|
|||
|
||||
default_settings = utils.get_settings()
|
||||
|
||||
with mock.patch("django_mailbox.utils.get_settings") as get_settings:
|
||||
with mock.patch("django_mailbox2.utils.get_settings") as get_settings:
|
||||
altered = copy.deepcopy(default_settings)
|
||||
altered["store_original_message"] = False
|
||||
get_settings.return_value = altered
|
||||
|
|
@ -391,7 +391,7 @@ class TestProcessEmail(EmailMessageTestCase):
|
|||
|
||||
default_settings = utils.get_settings()
|
||||
|
||||
with mock.patch("django_mailbox.utils.get_settings") as get_settings:
|
||||
with mock.patch("django_mailbox2.utils.get_settings") as get_settings:
|
||||
altered = copy.deepcopy(default_settings)
|
||||
altered["compress_original_message"] = True
|
||||
altered["store_original_message"] = True
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class CommandsTestCase(TestCase):
|
|||
# Mock handle so that the test doesn't hang waiting for input. Note that we are only testing
|
||||
# the argument parsing here -- functionality should be tested elsewhere
|
||||
with mock.patch(
|
||||
"django_mailbox.management.commands.processincomingmessage.Command.handle"
|
||||
"django_mailbox2.management.commands.processincomingmessage.Command.handle"
|
||||
) as handle:
|
||||
# Don't care about the return value
|
||||
handle.return_value = None
|
||||
|
|
@ -38,7 +38,7 @@ class CommandsTestCase(TestCase):
|
|||
mailbox_name = "foo_mailbox"
|
||||
|
||||
with mock.patch(
|
||||
"django_mailbox.management.commands.processincomingmessage.Command.handle"
|
||||
"django_mailbox2.management.commands.processincomingmessage.Command.handle"
|
||||
) as handle:
|
||||
handle.return_value = None
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ from os.path import exists
|
|||
from os import remove
|
||||
from django.test.utils import override_settings
|
||||
|
||||
from django_mailbox.tests.base import EmailMessageTestCase, get_email_as_text
|
||||
from django_mailbox.transports import ImapTransport, Pop3Transport
|
||||
from django_mailbox2.tests.base import EmailMessageTestCase, get_email_as_text
|
||||
from django_mailbox2.transports import ImapTransport, Pop3Transport
|
||||
|
||||
FAKE_UID_SEARCH_ANSWER = (
|
||||
"OK",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue