From bdff6302d3b7316afa3d8474cb05aa50d8233e87 Mon Sep 17 00:00:00 2001 From: Daniel Havlik Date: Tue, 12 Oct 2021 12:18:31 +0200 Subject: [PATCH] Document different username for admin user when using email as login. I stumbled upon this and had to read the source for finding out this helpful feature. --- docs/helpers.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/helpers.rst b/docs/helpers.rst index 774237b3..15dc9737 100644 --- a/docs/helpers.rst +++ b/docs/helpers.rst @@ -264,6 +264,9 @@ for database use (no need to specify the :func:`~pytest.mark.django_db` mark). An instance of a superuser, with username "admin" and password "password" (in case there is no "admin" user yet). +If :attr:`~django.contrib.auth.models.CustomUser.USERNAME_FIELD` is set to "email", +the username will be "admin@example.com". + Using the `admin_user` fixture will cause the test to automatically be marked for database use (no need to specify the :func:`~pytest.mark.django_db` mark).