1
0
mirror of https://github.com/django/django.git synced 2025-07-05 02:09:13 +00:00

[1.11.x] Added a test for Model._meta._property_names.

Backport of 36f09c8a29eaad6a7e903ddc3ea1e8b5954ee67a from master
This commit is contained in:
Adam Johnson 2017-06-05 08:27:55 -04:00 committed by Tim Graham
parent d6100b715d
commit fa8346b9a9
2 changed files with 9 additions and 0 deletions

View File

@ -39,6 +39,10 @@ class AbstractPerson(models.Model):
class Meta:
abstract = True
@property
def test_property(self):
return 1
class BasePerson(AbstractPerson):
# DATA fields

View File

@ -272,3 +272,8 @@ class ParentListTests(SimpleTestCase):
self.assertEqual(FirstParent._meta.get_parent_list(), [CommonAncestor])
self.assertEqual(SecondParent._meta.get_parent_list(), [CommonAncestor])
self.assertEqual(Child._meta.get_parent_list(), [FirstParent, SecondParent, CommonAncestor])
class PropertyNamesTests(SimpleTestCase):
def test_person(self):
self.assertEqual(AbstractPerson._meta._property_names, frozenset(['pk', 'test_property']))