-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Raise BadRequest error when the list id is illegal.
This tries to avoid hacking attempts that can get you banned.
- Loading branch information
1 parent
a723d11
commit b920d3e
Showing
3 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
import unittest | ||
|
||
|
||
class TestUnit(unittest.TestCase): | ||
def test_list_id_allowed(self): | ||
from collective.mailchimp.browser.newsletter import CHARS_ALLOWED as allowed | ||
|
||
self.assertTrue(allowed("abcde12345")) | ||
self.assertTrue(allowed("12345ABCDE")) | ||
self.assertTrue(allowed("4f17c3b08a")) | ||
self.assertTrue(allowed("html")) | ||
self.assertTrue(allowed("plain-text")) | ||
self.assertTrue(allowed("text/plain")) | ||
self.assertTrue(allowed("[email protected]")) | ||
self.assertTrue(allowed("[email protected]")) | ||
self.assertFalse(allowed("abcde1234' hack em")) | ||
self.assertFalse(allowed("abcde1234;")) | ||
self.assertFalse(allowed("abcde1234?")) |