Ejemplo n.º 1
0
    def test_single_user_scope_resolver(self):
        """
        Assert that we can resolve the system defined SingleUserScopeResolver
        """

        resolver = SingleUserScopeResolver()
        user_ids = resolver.resolve('user', {'user_id': 1}, {})
        self.assertEqual(user_ids, [1])
Ejemplo n.º 2
0
    def test_single_user_scope_resolver(self):
        """
        Assert that we can resolve the system defined SingleUserScopeResolver
        """

        resolver = SingleUserScopeResolver()
        user_ids = resolver.resolve('user', {'user_id': 1}, {})
        self.assertEquals(user_ids, [1])
Ejemplo n.º 3
0
def initialize(namespace_resolver=None, register_system_types=True):
    """
    Startup entry point for the Notification subsystem
    """

    # alert the application tiers that they should register their
    # notification types, but this optional (default=True)
    if register_system_types:
        perform_type_registrations.send(sender=None)

    # alert the application tiers that they should register their
    # notification timers/callbacks
    perform_timer_registrations.send(sender=None)

    # install the system-defined Notification Preferences
    create_default_notification_preferences()

    register_user_scope_resolver('user', SingleUserScopeResolver(), {})

    if not namespace_resolver:
        namespace_resolver = DefaultNotificationNamespaceResolver()

    register_namespace_resolver(namespace_resolver, None)