mirror of
https://github.com/django/django.git
synced 2025-08-02 18:13:02 +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
|
@ -776,7 +776,7 @@ class ModelRefreshTests(TestCase):
|
|||
|
||||
class TestRelatedObjectDeprecation(TestCase):
|
||||
def test_field_related_deprecation(self):
|
||||
field = SelfRef._meta.get_field_by_name('selfref')[0]
|
||||
field = SelfRef._meta.get_field('selfref')
|
||||
with warnings.catch_warnings(record=True) as warns:
|
||||
warnings.simplefilter('always')
|
||||
self.assertIsInstance(field.related, ForeignObjectRel)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue