mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #29619 -- Added field names to some FieldErrors.
This commit is contained in:
committed by
Tim Graham
parent
5013d38380
commit
741ce81a42
@@ -264,7 +264,8 @@ class BasicExpressionsTests(TestCase):
|
||||
|
||||
def test_object_create_with_aggregate(self):
|
||||
# Aggregates are not allowed when inserting new data
|
||||
with self.assertRaisesMessage(FieldError, 'Aggregate functions are not allowed in this query'):
|
||||
msg = 'Aggregate functions are not allowed in this query (num_employees=Max(Value(1))).'
|
||||
with self.assertRaisesMessage(FieldError, msg):
|
||||
Company.objects.create(
|
||||
name='Company', num_employees=Max(Value(1)), num_chairs=1,
|
||||
ceo=Employee.objects.create(firstname="Just", lastname="Doit", salary=30),
|
||||
|
||||
Reference in New Issue
Block a user