1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #23492 -- Restored F.__deepcopy__.

This reverts commit 3a66035107.
A regression test was also added.
This commit is contained in:
Baptiste Mispelon
2014-09-16 12:17:33 +02:00
parent ed7821231b
commit d63ac5b595
2 changed files with 14 additions and 0 deletions

View File

@@ -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):