mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	Fixed #29330 -- Fixed crash when pickling BaseExpression.
Regression in cfff2af02b.
			
			
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							1d5d4867f4
						
					
				
				
					commit
					60156750f6
				
			| @@ -1,4 +1,5 @@ | ||||
| import datetime | ||||
| import pickle | ||||
| import unittest | ||||
| import uuid | ||||
| from copy import deepcopy | ||||
| @@ -585,6 +586,11 @@ class BasicExpressionsTests(TestCase): | ||||
|         outer = Company.objects.filter(pk__in=Subquery(inner.values('pk'))) | ||||
|         self.assertEqual(outer.get().name, 'Test GmbH') | ||||
|  | ||||
|     def test_pickle_expression(self): | ||||
|         expr = Value(1, output_field=models.IntegerField()) | ||||
|         expr.convert_value  # populate cached property | ||||
|         self.assertEqual(pickle.loads(pickle.dumps(expr)), expr) | ||||
|  | ||||
|  | ||||
| class IterableLookupInnerExpressionsTests(TestCase): | ||||
|     @classmethod | ||||
|   | ||||
		Reference in New Issue
	
	Block a user