Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21304 closed Uncategorized (fixed)

Wrong call to create_user on https://docs.djangoproject.com/en/1.5/topics/testing/advanced/

Reported by: joao@… Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

In the page https://docs.djangoproject.com/en/1.5/topics/testing/advanced/ the first example has the following code:

self.user = User.objects.create_user(

first_name='jacob', email='jacob@…', password='top_secret')

If you run it, you'll get the following error:

TypeError: create_user() takes at least 2 arguments (3 given)

The correct code should be:

self.user = User.objects.create_user(

username='jacob', email='jacob@…', password='top_secret')

(username replacing first_name)

This may apply to other versions.

Change History (3)

comment:1 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 9704c49d5951aadbfc03624e399d881ebf7a3eb5:

Fixed #21304 -- Typo in docs/topics/testing/advanced.txt

Thanks joao at silvaneves.org for the report.

comment:2 by Tim Graham <timograham@…>, 11 years ago

In 4499dc81e2fb4d61fca7a988ee6198caf71ca173:

[1.6.x] Fixed #21304 -- Typo in docs/topics/testing/advanced.txt

Thanks joao at silvaneves.org for the report.

Backport of 9704c49d59 from master

comment:3 by Tim Graham <timograham@…>, 11 years ago

In 26d1496f9003cabc2aef17fd28e684b1767b0587:

[1.5.x] Fixed #21304 -- Typo in docs/topics/testing/advanced.txt

Thanks joao at silvaneves.org for the report.

Backport of 9704c49d59 from master

Note: See TracTickets for help on using tickets.
Back to Top