Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While importing GS faceted config, allow to purge at the criterion level #202

Closed
gbastien opened this issue Aug 28, 2020 · 6 comments
Closed

Comments

@gbastien
Copy link
Contributor

Hi @avoinea @alecghica

when migrating criteria it would be nice to be able to reapply a faceted config XML and purge only one criterion and not the entire criteria configuration.

Dos that sounds right to you to be able to handle purge="True"at the <criterion> level?

If so I will propose a PR.

Thank you!

Gauthier

@gbastien gbastien changed the title Allow to purge at the criterion level While importing GS faceted config, allow to purge at the criterion level Aug 28, 2020
@avoinea
Copy link
Member

avoinea commented Aug 28, 2020

@gbastien Sounds good.

I would still keep the purge at criteria level for backward compatibility. Thus:

  1. If you have <criteria purge="True"> then the old behavior will apply (all criterions are erased before import)
  2. Otherwise each <criterion purge="True"> will replace existing ones.

@gbastien
Copy link
Contributor Author

@avoinea

yes sure still useful at the <criteria> level, just need to define it at the <criterion> level.

Actually we apply a little XML file just redefining one single <criterion> and leaving others untouched.

I will propose a PR soon.

Thank you for follow up!

Gauthier

@gbastien
Copy link
Contributor Author

Hi @avoinea

working on this issue and adding tests to exportimport.txt, I could not make doctest fail, even when writing wrong things!

Looking at the doctest setup, it is due to the checker=Py23DocChecker() defined in test_doctests.py while configuring the exportimport.txt doctest.

You may test, if you remove the checker=Py23DocChecker() and run bin/test --test exportimport.txt, you have failing tests.

So I think that may be the case with other doctests as well...

So I do not know why this is failing and how to fix this...

Gauthier

@gbastien
Copy link
Contributor Author

Hi @avoinea

so under py2, you may write anything wrong in a doctest, it does not fail.

But maybe this will fail in your jenkins while running test on py3?

@gbastien
Copy link
Contributor Author

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

It should be
got = re.sub("u'(.*?)'", "'\\1'", got)
and not
got = re.sub("u'(.*?)'", "'\\1'", want)

I will propose a separated PR...

gbastien added a commit to gbastien/eea.facetednavigation that referenced this issue Aug 31, 2020
@gbastien
Copy link
Contributor Author

gbastien commented Sep 2, 2020

Fixed with #205

@gbastien gbastien closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants