Skip to content
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
3 changes: 2 additions & 1 deletion bitfield/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,5 +260,6 @@ def get_label(self, flag):
from django.db.backends.postgresql.base import Database
Database.extensions.register_adapter(Bit, lambda x: Database.extensions.AsIs(int(x)))
Database.extensions.register_adapter(BitHandler, lambda x: Database.extensions.AsIs(int(x)))
except ImproperlyConfigured:
# Ignore in psycopg3 where there is no Database.extensions nor any need to adapt types
except (ImproperlyConfigured, AttributeError):
pass
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def pytest_configure(config):

if test_db == 'postgres':
DATABASES['default'].update({
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'ENGINE': 'django.db.backends.postgresql',
'USER': 'postgres',
})
elif test_db == 'mysql':
Expand Down
10 changes: 7 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# Taken from:
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
envlist =
py{38,39,310}-django{32,40,41}-{sqlite,postgres},
py{38,39,310,311}-django{41}-{sqlite,postgres},
py{38,39,310}-django{32,40,41}-{sqlite,postgres}-psycopg2,
py{38,39,310,311}-django{41,42}-{sqlite,postgres}-psycopg2,
py311-django42-postgres-psycopg3,

[gh-actions]
python =
Expand All @@ -19,13 +20,16 @@ commands =
passenv = DB
deps =
pytest
psycopg2-binary>=2.8
psycopg2: psycopg2-binary>=2.8
psycopg3: psycopg[binary]>=3.1
django32: Django>=3.2,<3.3
django32: pytest-django>=4.2
django40: Django>=4.0,<4.1
django40: pytest-django>=4.5
django41: Django>=4.1,<4.2
django41: pytest-django>=4.5
django42: Django>=4.2,<4.3
django42: pytest-django>=4.5
setenv =
sqlite: DB=sqlite
postgres: DB=postgres