Skip to content

Commit be99516

Browse files
committed
: -> ; in interests regex
1 parent a2caffe commit be99516

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
@@ -275,6 +275,19 @@ def test_publish_should_fail_if_interest_contains_invalid_chars(self):
275275
'INSTANCE_ID',
276276
'SECRET_KEY'
277277
)
278+
with self.assertRaises(ValueError) as e:
279+
pn_client.publish(
280+
interests=['bad:interest'],
281+
publish_body={
282+
'apns': {
283+
'aps': {
284+
'alert': 'Hello World!',
285+
},
286+
},
287+
},
288+
)
289+
self.assertIn('"bad:interest" contains a forbidden character', str(e.exception))
290+
278291
with self.assertRaises(ValueError) as e:
279292
pn_client.publish(
280293
interests=['bad|interest'],

0 commit comments

Comments
 (0)