mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Refs #29738 -- Added test for serializing psycopg2's NumericRange with DecimalRangeField in migrations.
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						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), | ||||
|         ) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user