Skip to content
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: 2 additions & 0 deletions sendgrid/helpers/mail/asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def groups_to_display(self):

@groups_to_display.setter
def groups_to_display(self, value):
if value is not None and len(value) > 25:
raise ValueError("New groups_to_display exceeds max length of 25.")
self._groups_to_display = value

def get(self):
Expand Down
3 changes: 3 additions & 0 deletions test/test_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,9 @@ def test_unicode_values_in_substitutions_helper(self):
json.dumps(expected_result, sort_keys=True)
)

def test_asm_display_group_limit(self):
self.assertRaises(ValueError, ASM, 1, list(range(26)))

def test_disable_tracking(self):
tracking_settings = TrackingSettings()
tracking_settings.click_tracking = ClickTracking(False, False)
Expand Down