diff options
| author | Adam Johnson <me@adamj.eu> | 2017-06-05 08:27:55 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-06-05 09:05:53 -0400 |
| commit | fa8346b9a9d9e16c4b6e928648538fccf9c82a2e (patch) | |
| tree | 8df7d0eb94c07f06dcdf9452129a77f59e4f4b56 /tests | |
| parent | d6100b715d7804a74abaf47a30fa1d28e50dca4e (diff) | |
[1.11.x] Added a test for Model._meta._property_names.
Backport of 36f09c8a29eaad6a7e903ddc3ea1e8b5954ee67a from master
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/model_meta/models.py | 4 | ||||
| -rw-r--r-- | tests/model_meta/tests.py | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/model_meta/models.py b/tests/model_meta/models.py index 074db093f9..882ac2c9fd 100644 --- a/tests/model_meta/models.py +++ b/tests/model_meta/models.py @@ -39,6 +39,10 @@ class AbstractPerson(models.Model): class Meta: abstract = True + @property + def test_property(self): + return 1 + class BasePerson(AbstractPerson): # DATA fields diff --git a/tests/model_meta/tests.py b/tests/model_meta/tests.py index 9a692ffdd2..265e180331 100644 --- a/tests/model_meta/tests.py +++ b/tests/model_meta/tests.py @@ -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'])) |
