Skip to content

Commit

Permalink
test settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tbicr committed Apr 26, 2024
1 parent 4c55b53 commit 389be46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
3 changes: 3 additions & 0 deletions tests/integration/test_migrations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import textwrap

from django.conf import settings
from django.core.management import call_command
from django.db import connection
from django.test import modify_settings, override_settings
Expand Down Expand Up @@ -144,6 +145,8 @@ def test_decimal_to_float_app():
@override_settings(ZERO_DOWNTIME_MIGRATIONS_RAISE_FOR_UNSAFE=True)
@override_settings(ZERO_DOWNTIME_MIGRATIONS_IDEMPOTENT_SQL=True)
def test_idempotency_create_table():
assert settings.DATABASES["default"]["ENGINE"] == "django_zero_downtime_migrations.backends.postgres"

_create_table_sql = one_line_sql("""
CREATE TABLE "idempotency_create_table_app_relatedtesttable" (
"id" integer NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
Expand Down
22 changes: 5 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
[tox]
envlist =
py{3.10,3.11,3.12}-django{5.0}-psycopg{2,3}
py{3.8,3.9,3.10,3.11,3.12}-django{4.2}-psycopg{2,3}
py{3.8,3.9,3.10,3.11}-django{4.0,4.1}
py{3.6,3.7,3.8,3.9,3.10}-django{3.2}
py{3.11,3.12}-django{5.0}-psycopg{2,3}

[testenv]
usedevelop = True
allowlist_externals = bash
setenv =
DJANGO_SETTINGS_MODULE = tests.settings
commands =
py{3.12}-django{5.0}-psycopg{3}: flake8
py{3.12}-django{5.0}-psycopg{3}: isort . --check --diff

py{3.8,3.9,3.10,3.11,3.12}-django{4.2,5.0}-psycopg{2,3}: bash -c "DB_HOST=pg16 DB_USER=test pytest tests/unit"
py{3.8,3.9,3.10,3.11,3.12}-django{4.2,5.0}-psycopg{2,3}: bash -c "DB_HOST=postgis16 DB_USER=root DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/unit"

py{3.8,3.9,3.10,3.11}-django{4.0,4.1}: bash -c "DB_HOST=pg16 DB_USER=test pytest tests/unit"
py{3.8,3.9,3.10,3.11}-django{4.0,4.1}: bash -c "DB_HOST=postgis16 DB_USER=root DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/unit"

py{3.6,3.7,3.8,3.9,3.10}-django{3.2}: bash -c "DB_HOST=pg16 DB_USER=test pytest tests/unit"
py{3.6,3.7,3.8,3.9,3.10}-django{3.2}: bash -c "DB_HOST=postgis16 DB_USER=root DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/unit"
py{3.11,3.12}-django{5.0}-psycopg{2,3}: bash -c "DB_HOST=pg16 DB_USER=test pytest tests/unit"
py{3.11,3.12}-django{5.0}-psycopg{2,3}: bash -c "DB_HOST=postgis16 DB_USER=root DB_ENGINE=django_zero_downtime_migrations.backends.postgis pytest tests/unit"

py{3.12}-django{5.0}-psycopg{3}: bash -c "DB_HOST=pg16 DB_USER=test DB_SUPER_USER=root DB_ENGINE=django.db.backends.postgresql pytest tests/integration"
py{3.12}-django{5.0}-psycopg{3}: bash -c "DB_HOST=pg16 DB_USER=test DB_SUPER_USER=root pytest tests/integration"
Expand All @@ -38,12 +31,7 @@ deps =
pytest-django
pytest-mock

django{3.2,4.0,4.1}: psycopg2-binary
psycopg2: psycopg2-binary
psycopg3: psycopg[binary]

django3.2: django>=3.2,<4.0
django4.0: django>=4.0,<4.1
django4.1: django>=4.1,<4.2
django4.2: django>=4.2,<5.0
django5.0: django>=5.0,<5.1

0 comments on commit 389be46

Please sign in to comment.