move handlers to separate files

This commit is contained in:
Dmitry Afanasyev
2023-09-22 22:59:52 +03:00
committed by GitHub
parent 1ecf95631d
commit 315284fc38
8 changed files with 161 additions and 128 deletions

View File

@@ -1,35 +1,14 @@
import string
import time
import factory
from faker import Faker
from tests.integration.factories.models import Chat, User
data = {
"update_id": 957250703,
"message": {
"message_id": 417070387,
"from": {
"id": 1000,
"is_bot": "false",
"first_name": "William",
"last_name": "Dalton",
"username": "bolshakovfortunat",
"language_code": "ru",
},
"chat": {"id": 1, "first_name": "Gabrielle", "last_name": "Smith", "username": "arefi_2019", "type": "private"},
"date": time.time(),
"text": "/chatid",
"entities": [{"type": "bot_command", "offset": 0, "length": 7}],
},
}
faker = Faker("ru_RU")
class UserFactory(factory.Factory):
class BotUserFactory(factory.Factory):
id = factory.Sequence(lambda n: 1000 + n)
is_bot = False
first_name = factory.Faker("first_name")
@@ -41,7 +20,7 @@ class UserFactory(factory.Factory):
model = User
class ChatFactory(factory.Factory):
class BotChatFactory(factory.Factory):
id = factory.Sequence(lambda n: 1 + n)
first_name = factory.Faker("first_name")
last_name = factory.Faker("last_name")
@@ -70,3 +49,9 @@ class BotInfoFactory(factory.DictFactory):
class Meta:
exclude = ("channel_name", "fake_username")
class BotEntitleFactory(factory.DictFactory):
type = "bot_command"
offset = 0
length = 7