-
Notifications
You must be signed in to change notification settings - Fork 348
Allow to use email as USERNAME_FIELD. Tested. #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When do you expect to merge it with the master? As I am facing the same problem and for now I have to use a forked version from @gradam. |
When custom user model had 'email' field set as username filed the fixture was resulting in Error `TypeError: create_superuser() got multiple values for argument 'email'`. Additional checking if `username_field` is not equal to 'email' fixed it.
…d on admin_user instead getting username directly.
…me because we had to use custom email field which was not possible when inheriting from AbstractUser
Codecov Report
@@ Coverage Diff @@
## master #484 +/- ##
==========================================
+ Coverage 91.92% 91.97% +0.04%
==========================================
Files 33 33
Lines 1660 1670 +10
Branches 143 143
==========================================
+ Hits 1526 1536 +10
Misses 95 95
Partials 39 39
Continue to review full report at Codecov.
|
Do you need anything else for this to be merged? |
Related to the following pull requests/issues: pytest-dev#246 pytest-dev#484 pytest-dev#748 pytest-dev#457
The previous test setup inherited from AbstractUser thus MyCustomUser still had a username field. The problems people are having when using the admin_client fixture in combination with a custom user model are due to the username field not being present. This change accounts for the more realistic scenario. See these tickets: pytest-dev#246 pytest-dev#484 pytest-dev#748
The previous test setup inherited from AbstractUser thus MyCustomUser still had a username field. The problems people are having when using the admin_client fixture in combination with a custom user model are due to the username field not being present. This change accounts for the more realistic scenario. See these tickets: pytest-dev#246 pytest-dev#484 pytest-dev#748
The previous test setup inherited from AbstractUser thus MyCustomUser still had a username field. The problems people are having when using the admin_client fixture in combination with a custom user model are due to the username field not being present. This change accounts for the more realistic scenario. See these tickets: pytest-dev#246 pytest-dev#484 pytest-dev#748
The previous test setup inherited from AbstractUser thus MyCustomUser still had a username field. The problems people are having when using the admin_client fixture in combination with a custom user model are due to the username field not being present. This change accounts for the more realistic scenario. See these tickets: pytest-dev#246 pytest-dev#484 pytest-dev#748
Allow you to use email as username_field.
Also fixed a bug in an admin_client fixture that was caused by using username=admin_user.username instead of admin_user.get_username().