Opened 23 months ago

Closed 23 months ago

Last modified 23 months 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:
Needs tests: Patch needs improvement:
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 Changed 23 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 9704c49d5951aadbfc03624e399d881ebf7a3eb5:

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

Thanks joao at silvaneves.org for the report.

comment:2 Changed 23 months ago by Tim Graham <timograham@…>

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 Changed 23 months ago by Tim Graham <timograham@…>

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