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: 1 addition & 1 deletion pusher_push_notifications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

SDK_VERSION = '0.10.0'
INTEREST_MAX_LENGTH = 164
INTEREST_REGEX = re.compile('^(_|-|=|@|,|\\.|:|[A-Z]|[a-z]|[0-9])*$')
INTEREST_REGEX = re.compile('^(_|-|=|@|,|\\.|;|[A-Z]|[a-z]|[0-9])*$')
MAX_NUMBER_OF_INTERESTS = 100


Expand Down
13 changes: 13 additions & 0 deletions tests/test_push_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,19 @@ def test_publish_should_fail_if_interest_contains_invalid_chars(self):
'INSTANCE_ID',
'SECRET_KEY'
)
with self.assertRaises(ValueError) as e:
pn_client.publish(
interests=['bad:interest'],
publish_body={
'apns': {
'aps': {
'alert': 'Hello World!',
},
},
},
)
self.assertIn('"bad:interest" contains a forbidden character', str(e.exception))

with self.assertRaises(ValueError) as e:
pn_client.publish(
interests=['bad|interest'],
Expand Down