mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #29135 -- Prevented get_object/list_or_404() from hiding AttributeError raised by QuerySet filtering.
This commit is contained in:
		| @@ -94,3 +94,13 @@ class GetObjectOr404Tests(TestCase): | ||||
|         msg = "First argument to get_list_or_404() must be a Model, Manager, or QuerySet, not 'list'." | ||||
|         with self.assertRaisesMessage(ValueError, msg): | ||||
|             get_list_or_404([Article], title__icontains="Run") | ||||
|  | ||||
|     def test_get_object_or_404_queryset_attribute_error(self): | ||||
|         """AttributeError raised by QuerySet.get() isn't hidden.""" | ||||
|         with self.assertRaisesMessage(AttributeError, 'AttributeErrorManager'): | ||||
|             get_object_or_404(Article.attribute_error_objects, id=42) | ||||
|  | ||||
|     def test_get_list_or_404_queryset_attribute_error(self): | ||||
|         """AttributeError raised by QuerySet.filter() isn't hidden.""" | ||||
|         with self.assertRaisesMessage(AttributeError, 'AttributeErrorManager'): | ||||
|             get_list_or_404(Article.attribute_error_objects, title__icontains='Run') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user