Loading django/db/models/options.py +2 −2 Original line number Diff line number Diff line Loading @@ -535,8 +535,8 @@ class Options(object): # unavailable, therefore we throw a FieldDoesNotExist exception. if not self.apps.ready: raise FieldDoesNotExist( "%s has no field named %r. The app cache isn't " "ready yet, so if this is a forward field, it won't " "%s has no field named %r. The app cache isn't ready yet, " "so if this is an auto-created related field, it won't " "be available yet." % (self.object_name, field_name) ) Loading tests/model_meta/tests.py +3 −3 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ class GetFieldByNameTests(OptionsBaseTests): self.assertEqual(field_info[1:], (None, True, False)) self.assertIsInstance(field_info[0], GenericRelation) def test_get_fields_only_searaches_forward_on_apps_not_ready(self): def test_get_fields_only_searches_forward_on_apps_not_ready(self): opts = Person._meta # If apps registry is not ready, get_field() searches over only # forward fields. Loading @@ -179,8 +179,8 @@ class GetFieldByNameTests(OptionsBaseTests): self.assertTrue(opts.get_field('data_abstract')) msg = ( "Person has no field named 'relating_baseperson'. The app " "cache isn't ready yet, so if this is a forward field, it " "won't be available yet." "cache isn't ready yet, so if this is an auto-created related " "field, it won't be available yet." ) # 'data_abstract' is a reverse field, and will raise an exception with self.assertRaisesMessage(FieldDoesNotExist, msg): Loading Loading
django/db/models/options.py +2 −2 Original line number Diff line number Diff line Loading @@ -535,8 +535,8 @@ class Options(object): # unavailable, therefore we throw a FieldDoesNotExist exception. if not self.apps.ready: raise FieldDoesNotExist( "%s has no field named %r. The app cache isn't " "ready yet, so if this is a forward field, it won't " "%s has no field named %r. The app cache isn't ready yet, " "so if this is an auto-created related field, it won't " "be available yet." % (self.object_name, field_name) ) Loading
tests/model_meta/tests.py +3 −3 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ class GetFieldByNameTests(OptionsBaseTests): self.assertEqual(field_info[1:], (None, True, False)) self.assertIsInstance(field_info[0], GenericRelation) def test_get_fields_only_searaches_forward_on_apps_not_ready(self): def test_get_fields_only_searches_forward_on_apps_not_ready(self): opts = Person._meta # If apps registry is not ready, get_field() searches over only # forward fields. Loading @@ -179,8 +179,8 @@ class GetFieldByNameTests(OptionsBaseTests): self.assertTrue(opts.get_field('data_abstract')) msg = ( "Person has no field named 'relating_baseperson'. The app " "cache isn't ready yet, so if this is a forward field, it " "won't be available yet." "cache isn't ready yet, so if this is an auto-created related " "field, it won't be available yet." ) # 'data_abstract' is a reverse field, and will raise an exception with self.assertRaisesMessage(FieldDoesNotExist, msg): Loading