This commit is contained in:
MatthiasSaihttam 2021-12-21 23:59:28 -08:00
commit 0be3ed9f72
6 changed files with 21 additions and 10 deletions

View File

@ -10,8 +10,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.9]
xapian-version: [1.4.18]
python-version: ['3.6', '3.9', '3.10']
xapian-version: ['1.4.18']
steps:
- name: Set up Python ${{ matrix.python-version }}
@ -41,9 +41,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.9]
django-version: [2.2, 3.1, 3.2]
xapian-version: [1.4.18]
python-version: ['3.6', '3.9']
django-version: ['2.2', '3.1', '3.2']
xapian-version: ['1.4.18']
include:
# Django added python 3.10 support in 3.2.9
- python-version: '3.10'
django-version: '3.2'
xapian-version: '1.4.18'
steps:
- name: Set up Python ${{ matrix.python-version }}

View File

@ -2,6 +2,13 @@
xapian-haystack Changelog
=========================
v3.0.1 (2021-11-12)
-------------------
- Removed deprecated ``force_text`` usage, which will stop emitting
RemovedInDjango40Warning's.
- Test files are now included in release tarball.
v3.0.0 (2021-10-26)
-------------------

View File

@ -2,3 +2,4 @@ include AUTHORS
include CHANGELOG.rst
include LICENSE
include README.rst
recursive-include tests *.py

View File

@ -8,7 +8,7 @@ def read(fname):
setup(
name='xapian-haystack',
version='3.0.0',
version='3.0.1',
description='A Xapian backend for Haystack',
long_description=read('README.rst'),
long_description_content_type='text/x-rst',

View File

@ -9,7 +9,6 @@ import os
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django.utils.encoding import force_text
from haystack import connections
from haystack.backends.xapian_backend import InvalidIndexError, _term_to_xapian_value
@ -566,7 +565,7 @@ class BackendFeaturesTestCase(HaystackBackendTestCase, TestCase):
self.assertEqual(_term_to_xapian_value([1, 2, 3], 'text'), '[1, 2, 3]')
self.assertEqual(_term_to_xapian_value((1, 2, 3), 'text'), '(1, 2, 3)')
self.assertEqual(_term_to_xapian_value({'a': 1, 'c': 3, 'b': 2}, 'text'),
force_text({'a': 1, 'c': 3, 'b': 2}))
str({'a': 1, 'c': 3, 'b': 2}))
self.assertEqual(_term_to_xapian_value(datetime.datetime(2009, 5, 9, 16, 14), 'datetime'),
'20090509161400')
self.assertEqual(_term_to_xapian_value(datetime.datetime(2009, 5, 9, 0, 0), 'date'),

View File

@ -7,7 +7,6 @@ import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.encoding import force_text
from haystack import connections
from haystack.backends import BaseEngine, BaseSearchBackend, BaseSearchQuery, SearchNode, log_query
@ -1609,7 +1608,7 @@ def _to_xapian_term(term):
Converts a Python type to a
Xapian term that can be indexed.
"""
value = force_text(term).lower()
value = str(term).lower()
if LONG_TERM_METHOD:
value = _ensure_term_length(value)
return value