launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #07070
Re: create_initialized_view() confusion
On 11 May 2011 15:25, Gavin Panella <gavin.panella@xxxxxxxxxxxxx> wrote:
[...]
> 4. Calling create_initialized_view() with the default arguments for
> current_request (False) and principal (None) can cause confusion:
>
> >>> login_person(fred)
> >>> view = create_initialized_view(thing, "+someview")
> >>> get_current_principal().person == fred
> True
> >>> view.request.principal == fred
> False
That should be:
>>> view.request.principal == get_current_principal()
False
References