mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2026-02-04 16:50:38 +03:00
move handlers to separate files
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user