Fix Python3.11 unit test failures
In Python 3.11, regex have undergone changes in
how they handle Unicode characters. In Python3.11,
global flags must be placed right at the start of a
regular expression. The following regex:
validators.RegexValidator(r'^(?u)[^/]+$')
must become:
validators.RegexValidator(r'(?u)^[^/]+$')
Closes-Bug: #2036378
Change-Id: I3884ae5b3a32e33077cf3efeac649ac0c615fdda
This commit is contained in:
@@ -14,7 +14,7 @@ from django.core import validators
|
|||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
no_slash_validator = validators.RegexValidator(r'^(?u)[^/]+$',
|
no_slash_validator = validators.RegexValidator(r'(?u)^[^/]+$',
|
||||||
_("Slash is not an allowed "
|
_("Slash is not an allowed "
|
||||||
"character."),
|
"character."),
|
||||||
code="noslash")
|
code="noslash")
|
||||||
|
|||||||
Reference in New Issue
Block a user