Ejemplo n.º 1
0
    def test_unset_option_with_project(self):
        with mock.patch('sentry.models.ProjectOption.objects.unset_value'
                        ) as unset_value:
            project = mock.Mock()
            unset_option('key', project)

            unset_value.assert_called_once_with(project, 'key')
Ejemplo n.º 2
0
    def test_unset_option_with_project(self):
        with mock.patch(
                "sentry.models.options.ProjectOption.objects.unset_value"
        ) as unset_value:
            project = mock.Mock()
            unset_option("key", project)

            unset_value.assert_called_once_with(project, "key")
Ejemplo n.º 3
0
    def unset_option(self, key, project=None, user=None):
        """
        Removes an option in your plugins keyspace.

        If ``project`` is passed, it will limit the scope to that project's keyspace.

        >>> plugin.unset_option('my_option')
        """
        from sentry.plugins.helpers import unset_option
        return unset_option(self._get_option_key(key), project, user)
Ejemplo n.º 4
0
Archivo: v2.py Proyecto: mwcz/sentry
    def unset_option(self, key, project=None, user=None):
        """
        Removes an option in your plugins keyspace.

        If ``project`` is passed, it will limit the scope to that project's keyspace.

        >>> plugin.unset_option('my_option')
        """
        from sentry.plugins.helpers import unset_option
        return unset_option(self._get_option_key(key), project, user)
Ejemplo n.º 5
0
    def test_unset_option_without_project(self):
        with mock.patch(
                'sentry.models.Option.objects.unset_value') as unset_value:
            unset_option('key')

            unset_value.assert_called_once_with('key')
Ejemplo n.º 6
0
Archivo: tests.py Proyecto: 755/sentry
    def test_unset_option_without_project(self):
        with mock.patch('sentry.models.Option.objects.unset_value') as unset_value:
            unset_option('key')

            unset_value.assert_called_once_with('key')
Ejemplo n.º 7
0
Archivo: tests.py Proyecto: 755/sentry
    def test_unset_option_with_project(self):
        with mock.patch('sentry.models.ProjectOption.objects.unset_value') as unset_value:
            project = mock.Mock()
            unset_option('key', project)

            unset_value.assert_called_once_with(project, 'key')