summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauréline Guérin <zebuline@entrouvert.com>2019-10-24 14:10:14 (GMT)
committerLauréline Guérin <zebuline@entrouvert.com>2019-11-07 14:03:32 (GMT)
commitdd08e622e7a5bbe0d9a6cd7bda8a191a0585a1c8 (patch)
tree586b6c7f5d8c10db0083da1276f0c58b311742e2
parent6bc1152aca195a3f70f5fa28cfd1d281633a5112 (diff)
downloadcombo-wip/37175-wcs-anonymised-forms.zip
combo-wip/37175-wcs-anonymised-forms.tar.gz
combo-wip/37175-wcs-anonymised-forms.tar.bz2
wcs: exclude anonymised forms from search (#37175)wip/37175-wcs-anonymised-forms
-rw-r--r--combo/apps/wcs/__init__.py2
-rw-r--r--tests/test_search.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/combo/apps/wcs/__init__.py b/combo/apps/wcs/__init__.py
index 5aff7e4..aede109 100644
--- a/combo/apps/wcs/__init__.py
+++ b/combo/apps/wcs/__init__.py
@@ -47,7 +47,7 @@ class AppConfig(django.apps.AppConfig):
if len(services.keys()) > 1:
label = pgettext_lazy('user-forms', 'Forms (%s)') % service['title']
engines['formdata:%s' % hashlib.md5(force_bytes(key)).hexdigest()[:8]] = {
- 'url': service['url'] + 'api/forms/?NameID={{user_nameid}}&status=all&ignore-roles=on&q=%(q)s',
+ 'url': service['url'] + 'api/forms/?NameID={{user_nameid}}&status=all&ignore-roles=on&include-anonymised=off&q=%(q)s',
'label': label,
'signature': True,
'hit_url_template': '{% if readable %}{{ form_url_backoffice }}{% endif %}',
diff --git a/tests/test_search.py b/tests/test_search.py
index d110596..58c11c4 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -427,13 +427,16 @@ def test_manager_search_cell(app, admin_user):
**{'data-add-url': re.compile('search_searchcell')})['data-add-url'])
-
def test_wcs_search_engines(app):
with override_settings(KNOWN_SERVICES={}):
search_engines = engines.get_engines()
assert 'tracking-code' not in search_engines.keys()
assert len([x for x in search_engines.keys() if x.startswith('formdata:')]) == 0
+ for key, engine in engines.get_engines().items():
+ if key.startswith('formdata:'):
+ assert '&include-anonymised=off' in engine['url']
+
def test_profile_search_engines(app):
search_engines = engines.get_engines()