diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index 1af0b6e..c44eb72 100644
a
|
b
|
from django.db.models.expressions import (
|
17 | 17 | from django.db.models.functions import ( |
18 | 18 | Coalesce, Concat, Length, Lower, Substr, Upper, |
19 | 19 | ) |
20 | | from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature |
| 20 | from django.test import TestCase, mock, skipIfDBFeature, skipUnlessDBFeature |
21 | 21 | from django.test.utils import Approximate |
22 | 22 | from django.utils import six |
23 | 23 | from django.utils.timezone import utc |
… |
… |
class BasicExpressionsTests(TestCase):
|
315 | 315 | ) |
316 | 316 | self.assertRaisesMessage(ValueError, msg, acme.save) |
317 | 317 | |
| 318 | def test_insert_mock(self): |
| 319 | acme = Company.objects.create( |
| 320 | name="The Acme Widget Co.", |
| 321 | num_employees=mock.MagicMock(return_value=12), |
| 322 | num_chairs=5, |
| 323 | ceo=Employee.objects.latest('id'), |
| 324 | ) |
| 325 | |
318 | 326 | def test_ticket_11722_iexact_lookup(self): |
319 | 327 | Employee.objects.create(firstname="John", lastname="Doe") |
320 | 328 | Employee.objects.create(firstname="Test", lastname="test") |