forked from Github-Mirrors/canaille
fix: py310 unit tests
For some reasons, list["Client"] does not resolve the ForwardRef in python 3.10 as it does with typing.List["Client"], which in the end breaks the memory backend model accessors.
This commit is contained in:
parent
0b51b01031
commit
6b5e3e1a8e
1 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,9 @@
|
||||||
import datetime
|
import datetime
|
||||||
from typing import ClassVar
|
from typing import ClassVar
|
||||||
|
|
||||||
|
# keep 'List' instead of 'list' for audiences to not break py310 with the memory backend
|
||||||
|
from typing import List # noqa: UP035
|
||||||
|
|
||||||
from canaille.backends.models import Model
|
from canaille.backends.models import Model
|
||||||
from canaille.core.models import User
|
from canaille.core.models import User
|
||||||
|
|
||||||
|
@ -18,7 +21,8 @@ class Client(Model):
|
||||||
|
|
||||||
description: str | None = None
|
description: str | None = None
|
||||||
preconsent: bool | None = False
|
preconsent: bool | None = False
|
||||||
audience: list["Client"] = []
|
# keep 'List' instead of 'list' do not break py310 with the memory backend
|
||||||
|
audience: List["Client"] = [] # noqa: UP006
|
||||||
|
|
||||||
client_id: str | None
|
client_id: str | None
|
||||||
"""REQUIRED.
|
"""REQUIRED.
|
||||||
|
@ -320,7 +324,8 @@ class Token(Model):
|
||||||
issue_date: datetime.datetime
|
issue_date: datetime.datetime
|
||||||
lifetime: int
|
lifetime: int
|
||||||
revokation_date: datetime.datetime
|
revokation_date: datetime.datetime
|
||||||
audience: list["Client"]
|
# keep 'List' instead of 'list' do not break py310 with the memory backend
|
||||||
|
audience: List["Client"] # noqa: UP006
|
||||||
|
|
||||||
|
|
||||||
class Consent(Model):
|
class Consent(Model):
|
||||||
|
|
Loading…
Reference in a new issue