Fixed #27295 -- Added a system check to prohibit model names that start or end with an underscore or contain double underscores.

This commit is contained in:
Quentin Fulsher 2016-10-11 00:59:17 -07:00 committed by Tim Graham
parent 41759c9082
commit f62abfc03d
4 changed files with 73 additions and 2 deletions

View file

@ -794,7 +794,7 @@ class RelativeFieldTests(SimpleTestCase):
pass
for related_name in related_names:
Child = type(str('Child_%s') % str(related_name), (models.Model,), {
Child = type(str('Child%s') % str(related_name), (models.Model,), {
'parent': models.ForeignKey('Parent', models.CASCADE, related_name=related_name),
'__module__': Parent.__module__,
})