Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed: fix versions and updated test #60

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ testpaths = ["tests"]
DJANGO_SETTINGS_MODULE = "testapp.settings"

[tool.bumpversion]
current_version = "0.3.5"
current_version = "0.3.6"
files = [
{filename = "pyproject.toml"},
{filename = "README.rst"},
Expand Down
22 changes: 12 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
[bumpversion]
current_version = 0.3.7

[aliases]
test=pytest
test = pytest

[bdist_wheel]
universal=1
universal = 1

[pep8]
ignore=W293,W291,E501,E261
max-line-length=120
exclude=migrations,static,media
ignore = W293,W291,E501,E261
max-line-length = 120
exclude = migrations,static,media

[flake8]
ignore=E203,E261,E501,E731,F405,W293,W291,W503,F841,E741
max-line-length=120
exclude=env,.tox

python_paths=.
ignore = E203,E261,E501,E731,F405,W293,W291,W503,F841,E741
max-line-length = 120
exclude = env,.tox
python_paths = .
10 changes: 7 additions & 3 deletions tests/test_process_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ class ProcessTestCase(TestCase):
note the patched helpers are individually and more exhaustively tested elsewhere
"""

@patch("mail_editor.process.cid_for_bytes", return_value="MY_CID")
@patch("mail_editor.process.load_image", return_value=FileData(b"abc", "image/jpg"))
@patch("mail_editor.process.cid_for_bytes", return_value="MY_CID", autospec=True)
@patch(
"mail_editor.process.load_image",
return_value=FileData(b"abc", "image/jpg"),
autospec=True,
)
def test_extract_images(self, m1, m2):
html = """
<html><body>
Expand All @@ -27,7 +31,7 @@ def test_extract_images(self, m1, m2):
self.assertHTMLEqual(result.html, expected_html)
self.assertEqual(result.cid_attachments, [("MY_CID", b"abc", "image/jpg")])

@patch("mail_editor.process.load_image", return_value=None)
@patch("mail_editor.process.load_image", return_value=None, autospec=True)
def test_extract_images__keeps_absolute_url_when_not_loadable(self, m):
html = """
<html><body>
Expand Down
8 changes: 6 additions & 2 deletions tests/test_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ def test_send_email(self):
self.assertIn(str(_("Test mail sent from testcase with 111")), message.body)
self.assertEqual(message.attachments, [])

@patch("mail_editor.process.cid_for_bytes", return_value="MY_CID")
@patch("mail_editor.process.load_image", return_value=FileData(b"abc", "image/jpg"))
@patch("mail_editor.process.cid_for_bytes", return_value="MY_CID", autospec=True)
@patch(
"mail_editor.process.load_image",
return_value=FileData(b"abc", "image/jpg"),
autospec=True,
)
@override_settings(MAIL_EDITOR_CONF=CONFIG)
def test_send_email_processed_content(self, m0, m1):
subject_context = {"id": "111"}
Expand Down
Loading