mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	[schema] Add support for keeping track of iOS APNS device tokens
In order to support iOS Push Notifications, we need to keep track of a device's unique APNS Token. These are delivered to our iOS code after registering for remote notifications (imported from commit bbe34483e1380dc20a1c93e3ffa1fcfdb9087e67)
This commit is contained in:
		@@ -4175,6 +4175,25 @@ class CheckMessageTest(AuthedTestCase):
 | 
			
		||||
        self.assertEqual(new_count, old_count + 1)
 | 
			
		||||
        self.assertEqual(ret['message'].sender.email, 'othello-bot@zulip.com')
 | 
			
		||||
 | 
			
		||||
class APNSTokenTests(AuthedTestCase):
 | 
			
		||||
    def test_add_token(self):
 | 
			
		||||
        email = "cordelia@zulip.com"
 | 
			
		||||
        self.login(email)
 | 
			
		||||
 | 
			
		||||
        result = self.client.post('/json/users/me/apns_device_token', {'token': "test_token"})
 | 
			
		||||
        self.assert_json_success(result)
 | 
			
		||||
 | 
			
		||||
    def test_delete_token(self):
 | 
			
		||||
        email = "cordelia@zulip.com"
 | 
			
		||||
        self.login(email)
 | 
			
		||||
 | 
			
		||||
        token = "test_token"
 | 
			
		||||
        result = self.client.post('/json/users/me/apns_device_token', {'token':token})
 | 
			
		||||
        self.assert_json_success(result)
 | 
			
		||||
 | 
			
		||||
        result = self.client.delete('/json/users/me/apns_device_token', urllib.urlencode({'token': token}))
 | 
			
		||||
        self.assert_json_success(result)
 | 
			
		||||
 | 
			
		||||
def full_test_name(test):
 | 
			
		||||
    test_class = test.__class__.__name__
 | 
			
		||||
    test_method = test._testMethodName
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user