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

Support for Django 4 #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/tsvector_test_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
}
}
SECRET_KEY = 'test-key'

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
26 changes: 21 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[tox]
envlist = py{35,36}-django{1,2}
envlist =
clear
py{34,35,36,37}-django1
py{35,36,37,38,39}-django2
py{36,37,38,39,310}-django3
py{38,39,310,311}-django4
report
skip_missing_interpreters = true

[travis:env]
DJANGO =
Expand All @@ -12,11 +19,20 @@ setenv =
DJANGO_SETTINGS_MODULE=tsvector_test_app.settings

deps =
django1: django~=1.11.0
django2: git+https://github.com/django/django.git
django1: django==1.*
django2: django==2.*
django3: django==3.*
django4: django==4.1.*
psycopg2
coverage

commands =
coverage run -p --source={envsitepackagesdir}/tsvector_field {envbindir}/django-admin.py test tsvector_test_app
coverage combine
coverage run -p --source={envsitepackagesdir}/tsvector_field {envbindir}/django-admin test tsvector_test_app

[testenv:clear]
commands = -coverage erase

[testenv:report]
commands =
-coverage combine
-coverage report
5 changes: 4 additions & 1 deletion tsvector_field/fields.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django.core import checks
from django.db.models import CharField, TextField
from django.utils.encoding import force_text
try:
from django.utils.encoding import force_text
except ImportError:
from django.utils.encoding import force_str as force_text
from django.utils.itercompat import is_iterable
from django.contrib.postgres.search import SearchVectorField as OriginalSearchVectorField

Expand Down