Here is what I do in unit tests:
import os
def login_as(email):
    """
    Logs in as the user identified by the email.
    @param email: The email address of the user you want to login as.
    """
    # This is how you login
    os.environ['USER_EMAIL'] = email

On Apr 9, 11:55 am, slatvick <slatv...@gmail.com> wrote:
> I need to set a user (or login) automatically in test classes.
>
> users.User("email") does not work properly and returns new user each
> time as I understand.
>
> Thanks in advance.
> PS. Have not found an answer in posts.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to