#21304 closed Uncategorized (fixed)
Wrong call to create_user on https://docs.djangoproject.com/en/1.5/topics/testing/advanced/
Reported by: | 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.
Note:
See TracTickets
for help on using tickets.
In 9704c49d5951aadbfc03624e399d881ebf7a3eb5: