mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #29619 -- Added field names to some FieldErrors.
This commit is contained in:
parent
5013d38380
commit
741ce81a42
4 changed files with 38 additions and 9 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue