Skip to content

Commit b612c4c

Browse files
Merge pull request #7 from pusher/semicolon
: -> ; in interests regex
2 parents cf57d23 + be99516 commit b612c4c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

pusher_push_notifications/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

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

1414

tests/test_push_notifications.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,19 @@ def test_publish_should_fail_if_interest_contains_invalid_chars(self):
291291
'INSTANCE_ID',
292292
'SECRET_KEY'
293293
)
294+
with self.assertRaises(ValueError) as e:
295+
pn_client.publish(
296+
interests=['bad:interest'],
297+
publish_body={
298+
'apns': {
299+
'aps': {
300+
'alert': 'Hello World!',
301+
},
302+
},
303+
},
304+
)
305+
self.assertIn('"bad:interest" contains a forbidden character', str(e.exception))
306+
294307
with self.assertRaises(ValueError) as e:
295308
pn_client.publish(
296309
interests=['bad|interest'],

0 commit comments

Comments
 (0)