summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2014-09-16 12:17:33 +0200
committerBaptiste Mispelon <bmispelon@gmail.com>2014-09-16 12:19:00 +0200
commitd63ac5b595694c44ed8a64d782a177d2f92125d9 (patch)
treee8f23c28bc6d284ea2a2aadee4395cd372b19476 /tests
parented7821231b7dbf34a6c8ca65be3b9bcbda4a0703 (diff)
Fixed #23492 -- Restored F.__deepcopy__.
This reverts commit 3a66035107a640c4905f0a5f247a45f32dbe16d7. A regression test was also added.
Diffstat (limited to 'tests')
-rw-r--r--tests/expressions/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index 2bc40956a7..36cb95a5f7 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
+from copy import deepcopy
import datetime
from django.core.exceptions import FieldError
@@ -287,6 +288,14 @@ class ExpressionsTests(TestCase):
)
self.assertEqual(str(qs.query).count('JOIN'), 2)
+ def test_F_object_deepcopy(self):
+ """
+ Make sure F objects can be deepcopied (#23492)
+ """
+ f = F("foo")
+ g = deepcopy(f)
+ self.assertEqual(f.name, g.name)
+
class ExpressionsNumericTests(TestCase):