Closed gbastien closed 4 years ago
@avoinea a do a separated issue and PR because when fixing this, a test is broken...
Gauthier
@avoinea how do I trigger jenkins from my fork to show the failing test?
sadly this is probably not an easy test to fix... in unicode.txt, see https://github.com/gbastien/eea.facetednavigation/commit/80f54396b0da5eaca3409b062aafa13e271aed8e
actually in the test, no brains are returned
@gbastien
We have public travis on collective fork https://github.com/collective/eea.facetednavigation. If you have rights you can work there and then add pull-requests from collective.
You can also run docker commands on your local machine like:
$ cd eea.facetednavigation
$ docker run -it --rm -v $(pwd):/plone/instance/src/eea.facetednavigation -e ADDONS="eea.facetednavigation" -e DEVELOP="src/eea.facetednavigation" eeacms/plone-test:5 bash
$ bin/test -s eea.facetednavigation
@avoinea
the test is failing because, this is the query when unicode is the default widget value (widget hidden) :
{'facet.field': [u'Subject'], 'Language': '', 'Subject': {'operator': 'and', 'query': ['\xc5\x9etire']}}
and when the unicode value is passed to query (widget no more hidden) :
{'facet.field': [u'Subject'], 'Language': '', 'Subject': {'operator': 'and', 'query': [u'\u015etire']}}
So I do not know how it should be managed and where...
The fact is that when testing, if I enter a value with special chars in the browser, I do not receive a unicode but a utf-8 encoded value so the test is weird to me...
@gbastien I think this tests are there since Plone 2.5. Thus, if it doesn't have relevance for Plone 4 and 5, we can update it.
I added a subject with special chars (héhéhé) and used it in a checkbox widget.
When selecting it, I do receive utf-8 in the query method and not unicode so to me, in a normal way, this test can not happen.
I will fix it to use utf-8 when it is passed to query immediatelly.
Gauthier
@gbastien Plone 4, also?
@avoinea testing on Plone4 for now, testing on 5.2.2 to fix Py3 tests...
@avoinea every tests pass but this strangely failing test...
I tried with removing it, we will see if jenkins is ok, actually we test the value then change, so it is not really usefull test...
Fixed with #204
@avoinea @alecghica
this is due to https://github.com/eea/eea.facetednavigation/blob/master/eea/facetednavigation/tests/test_doctests.py#L25
Gauthier