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')
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")
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)
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')
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')
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')