mirror of
https://github.com/Balshgit/mosgortrans.git
synced 2026-02-03 11:20:56 +03:00
add selenoid tests
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import factory
|
||||
from faker import Faker
|
||||
from tests.data.models import User
|
||||
from tests.data.models import Chat, User
|
||||
|
||||
faker = Faker('ru_RU')
|
||||
|
||||
@@ -15,3 +15,14 @@ class UserFactory(factory.Factory):
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
|
||||
|
||||
class ChatFactory(factory.Factory):
|
||||
id = factory.Sequence(lambda n: 1 + n)
|
||||
first_name = factory.Faker('first_name')
|
||||
last_name = factory.Faker('last_name')
|
||||
username = faker.profile(fields=['username'])['username']
|
||||
type = 'private'
|
||||
|
||||
class Meta:
|
||||
model = Chat
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
""""
|
||||
Dict data set for Telegram message types
|
||||
"""
|
||||
from typing import Any, NamedTuple
|
||||
from typing import NamedTuple
|
||||
|
||||
|
||||
class User(NamedTuple):
|
||||
@@ -12,8 +12,13 @@ class User(NamedTuple):
|
||||
username: str | None
|
||||
language_code: str
|
||||
|
||||
def as_dict(self) -> dict[str, Any]:
|
||||
return self._asdict()
|
||||
|
||||
class Chat(NamedTuple):
|
||||
id: int
|
||||
first_name: str | None
|
||||
last_name: str | None
|
||||
username: str
|
||||
type: str
|
||||
|
||||
|
||||
USER = {
|
||||
|
||||
Reference in New Issue
Block a user