Refs #29738 -- Added test for serializing psycopg2's NumericRange with DecimalRangeField in migrations.
This commit is contained in:
parent
dc7ffd60d9
commit
52f6927d7f
|
@ -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),
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue