diff options
| author | Guilherme Martins Crocetti <gmcrocetti@gmail.com> | 2021-11-04 10:36:11 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-11-04 19:08:57 +0100 |
| commit | 52f6927d7fb7a4dca40afce0391d018b4c34dd6d (patch) | |
| tree | 2a821f8a4bc0250e555612442f4507ad7f45e8b5 /tests/postgres_tests | |
| parent | dc7ffd60d92cb376029d18b5e2251c883e8d70d0 (diff) | |
Refs #29738 -- Added test for serializing psycopg2's NumericRange with DecimalRangeField in migrations.
Diffstat (limited to 'tests/postgres_tests')
| -rw-r--r-- | tests/postgres_tests/test_apps.py | 6 |
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), ) |
