Fix many py3.12 SyntaxWarnings as per #3561
This commit is contained in:
parent
7b299f2cad
commit
381d34522b
8 changed files with 28 additions and 25 deletions
|
|
@ -44,7 +44,7 @@ class Migration(migrations.Migration):
|
|||
verbose_name="username",
|
||||
validators=[
|
||||
django.core.validators.RegexValidator(
|
||||
"^[\\w.@+-]+$", "Enter a valid username.", "invalid"
|
||||
r"^[\w.@+-]+$", "Enter a valid username.", "invalid"
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
import evennia.accounts.manager
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
@ -47,7 +46,7 @@ class Migration(migrations.Migration):
|
|||
max_length=30,
|
||||
validators=[
|
||||
django.core.validators.RegexValidator(
|
||||
"^[\\w.@+-]+$",
|
||||
r"^[\w.@+-]+$",
|
||||
"Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.",
|
||||
"invalid",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class Migration(migrations.Migration):
|
|||
unique=True,
|
||||
validators=[
|
||||
django.core.validators.RegexValidator(
|
||||
"^[\\w.@+-]+$",
|
||||
r"^[\w.@+-]+$",
|
||||
"Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.",
|
||||
)
|
||||
],
|
||||
|
|
|
|||
|
|
@ -3,18 +3,14 @@
|
|||
from random import randint
|
||||
from unittest import TestCase
|
||||
|
||||
from django.test import override_settings
|
||||
from mock import MagicMock, Mock, patch
|
||||
|
||||
import evennia
|
||||
from evennia.accounts.accounts import (
|
||||
AccountSessionHandler,
|
||||
DefaultAccount,
|
||||
DefaultGuest,
|
||||
)
|
||||
from django.test import override_settings
|
||||
from evennia.accounts.accounts import (AccountSessionHandler, DefaultAccount,
|
||||
DefaultGuest)
|
||||
from evennia.utils import create
|
||||
from evennia.utils.test_resources import BaseEvenniaTest
|
||||
from evennia.utils.utils import uses_database
|
||||
from mock import MagicMock, Mock, patch
|
||||
|
||||
|
||||
class TestAccountSessionHandler(TestCase):
|
||||
|
|
@ -172,7 +168,7 @@ class TestDefaultAccountAuth(BaseEvenniaTest):
|
|||
if not uses_database("mysql"):
|
||||
# TODO As of Mar 2019, mysql does not pass this test due to collation problems
|
||||
# that has not been possible to resolve
|
||||
result, error = DefaultAccount.validate_username("¯\_(ツ)_/¯")
|
||||
result, error = DefaultAccount.validate_username(r"¯\_(ツ)_/¯")
|
||||
self.assertFalse(result, "Validator allowed kanji in username.")
|
||||
|
||||
# Should not allow duplicate username
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue