eea / eea.facetednavigation

Faceted Navigation for Plone Classic
http://eea.github.com/docs/eea.facetednavigation
20 stars 56 forks source link

doc tests are never failing #203

Closed gbastien closed 4 years ago

gbastien commented 4 years ago

@avoinea @alecghica

this is due to https://github.com/eea/eea.facetednavigation/blob/master/eea/facetednavigation/tests/test_doctests.py#L25

Gauthier

gbastien commented 4 years ago

@avoinea a do a separated issue and PR because when fixing this, a test is broken...

Gauthier

gbastien commented 4 years ago

@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

avoinea commented 4 years ago

@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
gbastien commented 4 years ago

@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...

avoinea commented 4 years ago

@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.

gbastien commented 4 years ago

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

avoinea commented 4 years ago

@gbastien Plone 4, also?

gbastien commented 4 years ago

@avoinea testing on Plone4 for now, testing on 5.2.2 to fix Py3 tests...

gbastien commented 4 years ago

@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...

gbastien commented 4 years ago

Fixed with #204