'Login the user, given the `username`.'

def login_username(self, username):

    if (self.current_user != username):
        self.logout()
        user_email = User.objects.get(username=username).email
        self.login(user_email, 'test')
        self.current_user = username
