def create_default_notification_preferences(): """ This function installs two default system-defined Notification Preferences for daily and weekly Digests. """ store_provider = SQLNotificationStoreProvider() daily_digest_preference = NotificationPreference( name=const.NOTIFICATION_DAILY_DIGEST_PREFERENCE_NAME, display_name=_('Receive daily email'), display_description=_('This setting will cause a daily digest of all notifications to be sent to your' ' registered email address'), default_value=const.NOTIFICATIONS_PREFERENCE_DAILYDIGEST_DEFAULT ) store_provider.save_notification_preference(daily_digest_preference) weekly_digest_preference = NotificationPreference( name=const.NOTIFICATION_WEEKLY_DIGEST_PREFERENCE_NAME, display_name=_('Receive weekly email'), display_description=_('This setting will cause a weekly digest of all notifications to be sent to your' ' registered email address'), default_value=const.NOTIFICATIONS_PREFERENCE_WEEKLYDIGEST_DEFAULT ) store_provider.save_notification_preference(weekly_digest_preference)
def setUp(self): """ Setup the tests values. """ self.provider = SQLNotificationStoreProvider() self.test_user_id = 1 self.notification_type = NotificationType( name='foo.bar.baz', renderer='foo.renderer', renderer_context={'param1': 'value1'}, )
def setUp(self): """ Setup the test case """ self.provider = SQLNotificationStoreProvider() self.test_user_id = 1