Refs #16508 -- Renamed the current "virtual" fields to "private".

The only reason why GenericForeignKey and GenericRelation are stored
separately inside _meta is that they need to be cloned for every model
subclass, but that's not true for any other virtual field. Actually,
it's only true for GenericRelation.
This commit is contained in:
Michal Petrucha 2016-03-20 18:10:55 +01:00 committed by Tim Graham
parent 47fbbc33de
commit c339a5a6f7
14 changed files with 86 additions and 39 deletions

View file

@ -157,11 +157,11 @@ class RelatedObjectsTests(OptionsBaseTests):
)
class VirtualFieldsTests(OptionsBaseTests):
class PrivateFieldsTests(OptionsBaseTests):
def test_virtual_fields(self):
for model, expected_names in TEST_RESULTS['virtual_fields'].items():
objects = model._meta.virtual_fields
def test_private_fields(self):
for model, expected_names in TEST_RESULTS['private_fields'].items():
objects = model._meta.private_fields
self.assertEqual(sorted([f.name for f in objects]), sorted(expected_names))