divio / aldryn-search

Haystack 2.0 search index for django CMS
Other
48 stars 78 forks source link

AppConf not loaded while test run with pytest... #86

Closed jedie closed 6 years ago

jedie commented 6 years ago

Settings by AppConf will not be populated in some cases running tests with pytest...

The tests failed because of something like:

AttributeError: 'Settings' object has no attribute 'ALDRYN_SEARCH_DEFAULT_LANGUAGE'
AttributeError: 'Settings' object has no attribute 'ALDRYN_SEARCH_INDEX_BASE_CLASS'

Normaly #85 address this and fix it. But in my cases not. Don't know why... Maybe other people has the same problems and may give some feedback... Think this is not a real bug with aldryn-search, so i will close this issues, after creation ;)

My currently solution is a Pytest fixture that will invoked automatically and set the settings, see: https://gist.github.com/jedie/c119e73d8e7dad48183f9622b430373f

See also: https://github.com/django-compressor/django-appconf/issues/30