mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.8.x] Fixed #24146 -- Allowed model._meta.get_field() to be used after apps.models_ready
Backport of 19188826b4 from master
This commit is contained in:
committed by
Tim Graham
parent
c6a49d4f17
commit
fdcc9c47d5
@@ -178,7 +178,7 @@ class GetFieldByNameTests(OptionsBaseTests):
|
||||
opts = Person._meta
|
||||
# If apps registry is not ready, get_field() searches over only
|
||||
# forward fields.
|
||||
opts.apps.ready = False
|
||||
opts.apps.models_ready = False
|
||||
try:
|
||||
# 'data_abstract' is a forward field, and therefore will be found
|
||||
self.assertTrue(opts.get_field('data_abstract'))
|
||||
@@ -191,7 +191,7 @@ class GetFieldByNameTests(OptionsBaseTests):
|
||||
with self.assertRaisesMessage(FieldDoesNotExist, msg):
|
||||
opts.get_field('relating_baseperson')
|
||||
finally:
|
||||
opts.apps.ready = True
|
||||
opts.apps.models_ready = True
|
||||
|
||||
|
||||
class RelationTreeTests(TestCase):
|
||||
|
||||
Reference in New Issue
Block a user