mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #32460 -- Doc'd and tested that property names of model choice enums cannot be used as members.
This commit is contained in:
committed by
Mariusz Felisiak
parent
4894a97578
commit
41e39c41c9
@@ -155,6 +155,10 @@ class ChoicesTests(SimpleTestCase):
|
||||
output = template.render(Context({'Suit': Suit}))
|
||||
self.assertEqual(output, 'Diamond|1')
|
||||
|
||||
def test_property_names_conflict_with_member_names(self):
|
||||
with self.assertRaises(AttributeError):
|
||||
models.TextChoices('Properties', 'choices labels names values')
|
||||
|
||||
|
||||
class Separator(bytes, models.Choices):
|
||||
FS = b'\x1c', 'File Separator'
|
||||
|
||||
Reference in New Issue
Block a user