﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23488	Missing get_username in AnonymousUser	Damien Baty	Damien Baty	"The documentation says that ""`AnonymousUser` is a class that implements the `django.contrib.auth.models.User` interface"" [...] but `AnonymousUser` does not define the `get_username()` method.

I am modifying some foreign code that calls `get_username()` without first checking whether the user is authenticated or not. This may be bad practice, but I would expect `AnonymousUser` and `User` to have the same basic methods, including `get_username()`. It already has the `id`, `pk` and `username` attributes, as well as the `groups` and `user_permissions` accessors (that return empty sets).

Does that sound fine?

The changes are obvious. I cannot find any specific tests for the `*User` models that I could augment, but I do not see the point of adding an obvious unit test anyway. Would that need an addition in the documentation as well (perhaps a ""versionadded"" block) ?"	Bug	closed	contrib.auth	1.7	Normal	fixed		Damien Baty	Accepted	1	1	1	0	0	0
