mirror of
https://github.com/django/django.git
synced 2025-10-22 00:02:23 +00:00
Fixed #25016 -- Reallowed non-ASCII values for ForeignKey.related_name on Python 3.
This commit is contained in:
parent
60879a2193
commit
d3e12c9017
4 changed files with 25 additions and 6 deletions
|
@ -5,6 +5,7 @@ from django.core.checks import Error, Warning as DjangoWarning
|
|||
from django.db import models
|
||||
from django.test.testcases import skipIfDBFeature
|
||||
from django.test.utils import override_settings
|
||||
from django.utils import six
|
||||
|
||||
from .base import IsolatedModelsTestCase
|
||||
|
||||
|
@ -559,9 +560,12 @@ class RelativeFieldTests(IsolatedModelsTestCase):
|
|||
'contains_%s_whitespace' % whitespace,
|
||||
'ends_with_with_illegal_non_alphanumeric_%s' % illegal_non_alphanumeric,
|
||||
'ends_with_whitespace_%s' % whitespace,
|
||||
# Python's keyword
|
||||
'with',
|
||||
'with', # a Python keyword
|
||||
'related_name\n',
|
||||
]
|
||||
# Python 2 crashes on non-ASCII strings.
|
||||
if six.PY3:
|
||||
invalid_related_names.append(',')
|
||||
|
||||
class Parent(models.Model):
|
||||
pass
|
||||
|
@ -600,6 +604,9 @@ class RelativeFieldTests(IsolatedModelsTestCase):
|
|||
'_+',
|
||||
'+',
|
||||
]
|
||||
# Python 2 crashes on non-ASCII strings.
|
||||
if six.PY3:
|
||||
related_names.extend(['試', '試驗+'])
|
||||
|
||||
class Parent(models.Model):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue