# Path: user_management/models/tests/notifications.py
# class CustomPasswordResetNotification(PasswordResetNotification):
#     """Test setting a custom notification to alter how we send the password reset."""
#     text_email_template = 'my_custom_email.txt'
#     html_email_template = None
#     headers = {'test-header': 'Test'}
# 
# Path: user_management/models/mixins.py
# class AvatarMixin(models.Model):
#     avatar = models.ImageField(upload_to='user_avatar', null=True, blank=True)
# 
#     class Meta:
#         abstract = True
# 
# class BasicUserFieldsMixin(
#         DateJoinedUserMixin, EmailUserMixin, IsStaffUserMixin, NameUserMixin):
#     class Meta:
#         abstract = True
# 
# class DateJoinedUserMixin(models.Model):
#     date_joined = models.DateTimeField(
#         verbose_name=_('date joined'),
#         default=timezone.now,
#         editable=False,
#     )
# 
#     class Meta:
#         abstract = True
# 
# class EmailUserMixin(models.Model):
#     email = CIEmailField(
#         verbose_name=_('Email address'),
#         unique=True,
#         max_length=511,
#     )
#     email_verified = True
# 
#     objects = UserManager()
# 
#     USERNAME_FIELD = 'email'
# 
#     class Meta:
#         abstract = True
# 
# class EmailVerifyUserMixin(EmailVerifyUserMethodsMixin, models.Model):
#     is_active = models.BooleanField(_('active'), default=False)
#     email_verified = models.BooleanField(
#         _('Email verified?'),
#         default=False,
#         help_text=_('Indicates if the email address has been verified.'))
# 
#     objects = VerifyEmailManager()
# 
#     class Meta:
#         abstract = True
# 
#     @classmethod
#     def check(cls, **kwargs):
#         errors = super(EmailVerifyUserMixin, cls).check(**kwargs)
#         errors.extend(cls._check_manager(**kwargs))
#         return errors
# 
#     @classmethod
#     def _check_manager(cls, **kwargs):
#         if isinstance(cls.objects, VerifyEmailManager):
#             return []
# 
#         return [
#             checks.Warning(
#                 "Manager should be an instance of 'VerifyEmailManager'",
#                 hint="Subclass a custom manager from 'VerifyEmailManager'",
#                 obj=cls,
#                 id='user_management.W001',
#             ),
#         ]
# 
# class IsStaffUserMixin(models.Model):
#     is_staff = models.BooleanField(_('staff status'), default=False)
# 
#     class Meta:
#         abstract = True
# 
# class NameUserMethodsMixin:
#     def get_full_name(self):
#         return self.name
# 
#     def get_short_name(self):
#         return self.name
# 
#     def __str__(self):
#         return self.name
# 
# class VerifyEmailMixin(EmailVerifyUserMixin, BasicUserFieldsMixin):
#     class Meta:
#         abstract = True


from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.db import models
from .notifications import CustomPasswordResetNotification
from ..mixins import (
    AvatarMixin,
    BasicUserFieldsMixin,
    DateJoinedUserMixin,
    EmailUserMixin,
    EmailVerifyUserMixin,
    IsStaffUserMixin,
    NameUserMethodsMixin,
    VerifyEmailMixin,
)




class User(AvatarMixin, VerifyEmailMixin, PermissionsMixin, AbstractBaseUser):
    pass


class BasicUser(BasicUserFieldsMixin, AbstractBaseUser):
    pass


class VerifyEmailUser(VerifyEmailMixin, AbstractBaseUser):
    pass


class CustomVerifyEmailUser(VerifyEmailMixin, AbstractBaseUser):
    """Customise the notification class to send a password reset."""

# Path: user_management/models/tests/notifications.py
# class CustomPasswordResetNotification(PasswordResetNotification):
#     """Test setting a custom notification to alter how we send the password reset."""
#     text_email_template = 'my_custom_email.txt'
#     html_email_template = None
#     headers = {'test-header': 'Test'}
# 
# Path: user_management/models/mixins.py
# class AvatarMixin(models.Model):
#     avatar = models.ImageField(upload_to='user_avatar', null=True, blank=True)
# 
#     class Meta:
#         abstract = True
# 
# class BasicUserFieldsMixin(
#         DateJoinedUserMixin, EmailUserMixin, IsStaffUserMixin, NameUserMixin):
#     class Meta:
#         abstract = True
# 
# class DateJoinedUserMixin(models.Model):
#     date_joined = models.DateTimeField(
#         verbose_name=_('date joined'),
#         default=timezone.now,
#         editable=False,
#     )
# 
#     class Meta:
#         abstract = True
# 
# class EmailUserMixin(models.Model):
#     email = CIEmailField(
#         verbose_name=_('Email address'),
#         unique=True,
#         max_length=511,
#     )
#     email_verified = True
# 
#     objects = UserManager()
# 
#     USERNAME_FIELD = 'email'
# 
#     class Meta:
#         abstract = True
# 
# class EmailVerifyUserMixin(EmailVerifyUserMethodsMixin, models.Model):
#     is_active = models.BooleanField(_('active'), default=False)
#     email_verified = models.BooleanField(
#         _('Email verified?'),
#         default=False,
#         help_text=_('Indicates if the email address has been verified.'))
# 
#     objects = VerifyEmailManager()
# 
#     class Meta:
#         abstract = True
# 
#     @classmethod
#     def check(cls, **kwargs):
#         errors = super(EmailVerifyUserMixin, cls).check(**kwargs)
#         errors.extend(cls._check_manager(**kwargs))
#         return errors
# 
#     @classmethod
#     def _check_manager(cls, **kwargs):
#         if isinstance(cls.objects, VerifyEmailManager):
#             return []
# 
#         return [
#             checks.Warning(
#                 "Manager should be an instance of 'VerifyEmailManager'",
#                 hint="Subclass a custom manager from 'VerifyEmailManager'",
#                 obj=cls,
#                 id='user_management.W001',
#             ),
#         ]
# 
# class IsStaffUserMixin(models.Model):
#     is_staff = models.BooleanField(_('staff status'), default=False)
# 
#     class Meta:
#         abstract = True
# 
# class NameUserMethodsMixin:
#     def get_full_name(self):
#         return self.name
# 
#     def get_short_name(self):
#         return self.name
# 
#     def __str__(self):
#         return self.name
# 
# class VerifyEmailMixin(EmailVerifyUserMixin, BasicUserFieldsMixin):
#     class Meta:
#         abstract = True


# Path: user_management/models/tests/models.py
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.db import models
from .notifications import CustomPasswordResetNotification
from ..mixins import (
    AvatarMixin,
    BasicUserFieldsMixin,
    DateJoinedUserMixin,
    EmailUserMixin,
    EmailVerifyUserMixin,
    IsStaffUserMixin,
    NameUserMethodsMixin,
    VerifyEmailMixin,
)





class User(AvatarMixin, VerifyEmailMixin, PermissionsMixin, AbstractBaseUser):
    pass


class BasicUser(BasicUserFieldsMixin, AbstractBaseUser):
    pass


class VerifyEmailUser(VerifyEmailMixin, AbstractBaseUser):
    pass


class CustomVerifyEmailUser(VerifyEmailMixin, AbstractBaseUser):
    """Customise the notification class to send a password reset."""

    password_reset_notification = CustomPasswordResetNotification