tests/auth_tests/models/is_active.py
raw| 1 | from django.contrib.auth.models import AbstractBaseUser, BaseUserManager |
| 2 | from django.db import models |
| 3 | |
| 4 | |
| 5 | class IsActiveTestUser1(AbstractBaseUser): |
| 6 | """ |
| 7 | This test user class and derivatives test the default is_active behavior |
| 8 | """ |
| 9 | |
| 10 | username = models.CharField(max_length=30, unique=True) |
| 11 | |
| 12 | custom_objects = BaseUserManager() |
| 13 | |
| 14 | USERNAME_FIELD = "username" |
| 15 | |
| 16 | # the is_active attr is provided by AbstractBaseUser |