mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2026-02-03 11:40:39 +03:00
add ban user action (#77)
* add ban user action * fix tests * send message through update.effective_message
This commit is contained in:
20
bot_microservice/tests/integration/factories/user.py
Normal file
20
bot_microservice/tests/integration/factories/user.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import factory
|
||||
|
||||
from core.auth.models.users import User
|
||||
from tests.integration.factories.utils import BaseModelFactory
|
||||
|
||||
|
||||
class UserFactory(BaseModelFactory):
|
||||
id = factory.Sequence(lambda n: n + 1)
|
||||
email = factory.Faker("email")
|
||||
username = factory.Faker("user_name", locale="en_EN")
|
||||
first_name = factory.Faker("word")
|
||||
last_name = factory.Faker("word")
|
||||
ban_reason = factory.Faker("text", max_nb_chars=100)
|
||||
hashed_password = factory.Faker("word")
|
||||
is_active = True
|
||||
is_superuser = False
|
||||
created_at = factory.Faker("past_datetime")
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
Reference in New Issue
Block a user