mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #12663 -- Formalized the Model._meta API for retrieving fields.
Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
This commit is contained in:
parent
749d23251b
commit
fb48eb0581
58 changed files with 2851 additions and 1195 deletions
|
@ -2093,7 +2093,7 @@ class CloneTests(TestCase):
|
|||
testing is impossible, this is a sanity check against invalid use of
|
||||
deepcopy. refs #16759.
|
||||
"""
|
||||
opts_class = type(Note._meta.get_field_by_name("misc")[0])
|
||||
opts_class = type(Note._meta.get_field("misc"))
|
||||
note_deepcopy = getattr(opts_class, "__deepcopy__", None)
|
||||
opts_class.__deepcopy__ = lambda obj, memo: self.fail("Model fields shouldn't be cloned")
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue