コード例 #1
0
ファイル: test_course_updates.py プロジェクト: eliesmr4/myedx
 def test_notifications_error_from_parse(self, mock_parse_push,
                                         mock_log_exception):
     PushNotificationConfig(enabled=True).save()
     from parse_rest.core import ParseError
     mock_parse_push.alert.side_effect = ParseError
     self.post_course_update(send_push_notification=True)
     self.assertTrue(mock_log_exception.called)
コード例 #2
0
 def test_notifications_enabled(self):
     PushNotificationConfig(enabled=True).save()
     self.assertTrue(PushNotificationConfig.is_enabled())
コード例 #3
0
 def test_notifications_defaults(self):
     self.assertFalse(PushNotificationConfig.is_enabled())
コード例 #4
0
 def test_notifications_sent_to_parse(self, mock_parse_push):
     PushNotificationConfig(enabled=True).save()
     self.post_course_update(send_push_notification=True)
     self.assertEquals(mock_parse_push.alert.call_count, 2)
コード例 #5
0
 def test_notifications_enabled_and_sent(self, mock_push_update):
     PushNotificationConfig(enabled=True).save()
     self.post_course_update(send_push_notification=True)
     self.assertTrue(mock_push_update.called)
コード例 #6
0
 def test_notifications_enabled_but_not_requested(self, mock_push_update):
     PushNotificationConfig(enabled=True).save()
     self.post_course_update()
     self.assertFalse(mock_push_update.called)
コード例 #7
0
def push_notification_enabled():
    """
    Returns whether the push notification feature is enabled.
    """
    return PushNotificationConfig.is_enabled()
コード例 #8
0
ファイル: tests.py プロジェクト: cmscom/edx-platform
 def test_notifications_enabled(self):
     PushNotificationConfig(enabled=True).save()
     self.assertTrue(PushNotificationConfig.is_enabled())
コード例 #9
0
ファイル: tests.py プロジェクト: cmscom/edx-platform
 def test_notifications_defaults(self):
     self.assertFalse(PushNotificationConfig.is_enabled())
コード例 #10
0
def push_notification_enabled():
    """
    Returns whether the push notification feature is enabled.
    """
    return PushNotificationConfig.is_enabled()