summaryrefslogtreecommitdiff
path: root/tests/postgres_tests/test_apps.py
diff options
context:
space:
mode:
authorGuilherme Martins Crocetti <gmcrocetti@gmail.com>2021-11-04 10:36:11 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-11-04 19:08:57 +0100
commit52f6927d7fb7a4dca40afce0391d018b4c34dd6d (patch)
tree2a821f8a4bc0250e555612442f4507ad7f45e8b5 /tests/postgres_tests/test_apps.py
parentdc7ffd60d92cb376029d18b5e2251c883e8d70d0 (diff)
Refs #29738 -- Added test for serializing psycopg2's NumericRange with DecimalRangeField in migrations.
Diffstat (limited to 'tests/postgres_tests/test_apps.py')
-rw-r--r--tests/postgres_tests/test_apps.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/postgres_tests/test_apps.py b/tests/postgres_tests/test_apps.py
index bfb7568d50..94001822c2 100644
--- a/tests/postgres_tests/test_apps.py
+++ b/tests/postgres_tests/test_apps.py
@@ -1,3 +1,5 @@
+from decimal import Decimal
+
from django.db.backends.signals import connection_created
from django.db.migrations.writer import MigrationWriter
from django.test.utils import modify_settings
@@ -10,7 +12,8 @@ try:
)
from django.contrib.postgres.fields import (
- DateRangeField, DateTimeRangeField, IntegerRangeField,
+ DateRangeField, DateTimeRangeField, DecimalRangeField,
+ IntegerRangeField,
)
except ImportError:
pass
@@ -29,6 +32,7 @@ class PostgresConfigTests(PostgreSQLTestCase):
(DateRange(empty=True), DateRangeField),
(DateTimeRange(empty=True), DateRangeField),
(DateTimeTZRange(None, None, '[]'), DateTimeRangeField),
+ (NumericRange(Decimal('1.0'), Decimal('5.0'), '()'), DecimalRangeField),
(NumericRange(1, 10), IntegerRangeField),
)