Skip to content

Commit

Permalink
Merge pull request #60 from maykinmedia/fix/various
Browse files Browse the repository at this point in the history
Mixed: fix versions and updated test
  • Loading branch information
Bartvaderkin authored Mar 5, 2024
2 parents 5ca40a9 + c04166a commit 4b47a3a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
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

0 comments on commit 4b47a3a

Please sign in to comment.