mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #23492 -- Restored F.__deepcopy__.
This reverts commit 3a66035107.
A regression test was also added.
This commit is contained in:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user