add ban user action (#77)

* add ban user action

* fix tests

* send message through update.effective_message
This commit is contained in:
Dmitry Afanasyev
2024-01-07 16:08:23 +03:00
committed by GitHub
parent 1e79c981c2
commit 8266342214
9 changed files with 89 additions and 12 deletions

View 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