diff --git a/pyproject.toml b/pyproject.toml index 2bf54fa..ea48b5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"}, diff --git a/setup.cfg b/setup.cfg index 44f7e3b..a2184c9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 = . diff --git a/tests/test_process_html.py b/tests/test_process_html.py index 8d8b0fd..1148c39 100644 --- a/tests/test_process_html.py +++ b/tests/test_process_html.py @@ -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 = """ @@ -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 = """ diff --git a/tests/test_send.py b/tests/test_send.py index b965568..ac2a936 100644 --- a/tests/test_send.py +++ b/tests/test_send.py @@ -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"}