diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2009-07-16 16:06:53 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2009-07-16 16:06:53 +0000 |
| commit | 49f0a4bb5bb3ef5c22873de799570372dbc1d4e4 (patch) | |
| tree | b53d9bf50328fc7d38cf6f8f4b179cb61d10ac9e /docs/topics/testing.txt | |
| parent | 93d86479e377eb5a3f3fb8436a1ddcbfb9ad9b7e (diff) | |
Fixed #10908 -- Clarified the procedure for creating test users in the testing docs. Thanks to gruszczy and timo.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11248 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics/testing.txt')
| -rw-r--r-- | docs/topics/testing.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt index d235e0deba..cec6002b7b 100644 --- a/docs/topics/testing.txt +++ b/docs/topics/testing.txt @@ -686,7 +686,13 @@ arguments at time of construction: user accounts that are valid on your production site will not work under test conditions. You'll need to create users as part of the test suite -- either manually (using the Django model API) or with a test - fixture. + fixture. Remember that if you want your test user to have a password, + you can't set the user's password by setting the password attribute + directly -- you must use the + :meth:`~django.contrib.auth.models.User.set_password()` function to + store a correctly hashed password. Alternatively, you can use the + :meth:`~django.contrib.auth.models.UserManager.create_user` helper + method to create a new user with a correctly hashed password. .. method:: Client.logout() |
