Exemplo 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')
Exemplo 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")
Exemplo 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)
Exemplo n.º 4
0
Arquivo: v2.py Projeto: 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)
Exemplo 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')
Exemplo n.º 6
0
Arquivo: tests.py Projeto: 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')
Exemplo n.º 7
0
Arquivo: tests.py Projeto: 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')