From 572038dc29e2084f2981f8a1c57abd36b8427dba Mon Sep 17 00:00:00 2001 From: Stephen Young Date: Tue, 5 May 2026 22:31:40 -0400 Subject: [PATCH 1/3] Fix disable css preprocessing spelling --- customerio/api.py | 18 +++++++++++++++--- tests/test_api.py | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/customerio/api.py b/customerio/api.py index 7f09727..41c5d1e 100644 --- a/customerio/api.py +++ b/customerio/api.py @@ -43,7 +43,7 @@ def _payload_from_fields(source, field_map): "send_to_unsubscribed": "send_to_unsubscribed", "tracked": "tracked", "attachments": "attachments", - "disable_css_preproceessing": "disable_css_preproceessing", + "disable_css_preprocessing": "disable_css_preprocessing", } PUSH_FIELD_MAP = COMMON_MESSAGE_FIELD_MAP | { @@ -152,10 +152,14 @@ def __init__( queue_draft=None, message_data=None, attachments=None, - disable_css_preproceessing=None, + disable_css_preprocessing=None, send_at=None, language=None, + disable_css_preproceessing=None, ): + if disable_css_preprocessing is None: + disable_css_preprocessing = disable_css_preproceessing + self.transactional_message_id = transactional_message_id self.to = to self.identifiers = identifiers @@ -175,10 +179,18 @@ def __init__( self.queue_draft = queue_draft self.message_data = message_data self.attachments = attachments - self.disable_css_preproceessing = disable_css_preproceessing + self.disable_css_preprocessing = disable_css_preprocessing self.send_at = send_at self.language = language + @property + def disable_css_preproceessing(self): + return self.disable_css_preprocessing + + @disable_css_preproceessing.setter + def disable_css_preproceessing(self, value): + self.disable_css_preprocessing = value + def attach(self, name, content, encode=True): """Helper method to add base64-encoded attachments.""" if not self.attachments: diff --git a/tests/test_api.py b/tests/test_api.py index 2b71c63..641cdfd 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -96,6 +96,22 @@ def test_send_email(self): self.client.send_email(email) + def test_send_email_disable_css_preprocessing(self): + email = SendEmailRequest(disable_css_preprocessing=True) + payload = email._to_dict() + + self.assertEqual(payload["disable_css_preprocessing"], True) + self.assertNotIn("disable_css_preproceessing", payload) + + def test_send_email_disable_css_preprocessing_legacy_alias(self): + email = SendEmailRequest(disable_css_preproceessing=True) + email.disable_css_preproceessing = False + payload = email._to_dict() + + self.assertEqual(email.disable_css_preprocessing, False) + self.assertEqual(payload["disable_css_preprocessing"], False) + self.assertNotIn("disable_css_preproceessing", payload) + def test_send_push(self): self.client.http.hooks = dict( response=partial( From 84347ef2dd43dc997fc016260958649e4e23f673 Mon Sep 17 00:00:00 2001 From: Stephen Young Date: Tue, 5 May 2026 22:36:02 -0400 Subject: [PATCH 2/3] Remove typo compatibility for css preprocessing --- customerio/api.py | 12 ------------ tests/test_api.py | 11 +++-------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/customerio/api.py b/customerio/api.py index 41c5d1e..538bf8a 100644 --- a/customerio/api.py +++ b/customerio/api.py @@ -155,11 +155,7 @@ def __init__( disable_css_preprocessing=None, send_at=None, language=None, - disable_css_preproceessing=None, ): - if disable_css_preprocessing is None: - disable_css_preprocessing = disable_css_preproceessing - self.transactional_message_id = transactional_message_id self.to = to self.identifiers = identifiers @@ -183,14 +179,6 @@ def __init__( self.send_at = send_at self.language = language - @property - def disable_css_preproceessing(self): - return self.disable_css_preprocessing - - @disable_css_preproceessing.setter - def disable_css_preproceessing(self, value): - self.disable_css_preprocessing = value - def attach(self, name, content, encode=True): """Helper method to add base64-encoded attachments.""" if not self.attachments: diff --git a/tests/test_api.py b/tests/test_api.py index 641cdfd..a325059 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -103,14 +103,9 @@ def test_send_email_disable_css_preprocessing(self): self.assertEqual(payload["disable_css_preprocessing"], True) self.assertNotIn("disable_css_preproceessing", payload) - def test_send_email_disable_css_preprocessing_legacy_alias(self): - email = SendEmailRequest(disable_css_preproceessing=True) - email.disable_css_preproceessing = False - payload = email._to_dict() - - self.assertEqual(email.disable_css_preprocessing, False) - self.assertEqual(payload["disable_css_preprocessing"], False) - self.assertNotIn("disable_css_preproceessing", payload) + def test_send_email_disable_css_preprocessing_rejects_typo(self): + with self.assertRaises(TypeError): + SendEmailRequest(disable_css_preproceessing=True) def test_send_push(self): self.client.http.hooks = dict( From d898feb2b468270adc88700293e42e80d4d6e23d Mon Sep 17 00:00:00 2001 From: Stephen Young Date: Tue, 5 May 2026 22:37:40 -0400 Subject: [PATCH 3/3] Drop extra css preprocessing tests --- tests/test_api.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index a325059..2b71c63 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -96,17 +96,6 @@ def test_send_email(self): self.client.send_email(email) - def test_send_email_disable_css_preprocessing(self): - email = SendEmailRequest(disable_css_preprocessing=True) - payload = email._to_dict() - - self.assertEqual(payload["disable_css_preprocessing"], True) - self.assertNotIn("disable_css_preproceessing", payload) - - def test_send_email_disable_css_preprocessing_rejects_typo(self): - with self.assertRaises(TypeError): - SendEmailRequest(disable_css_preproceessing=True) - def test_send_push(self): self.client.http.hooks = dict( response=partial(