def login(self, username): """Login as the given user""" tc.add_auth("", self.url, username, username) self.go_to_front() tc.find("Login") tc.follow("Login") # We've provided authentication info earlier, so this should # redirect back to the base url. tc.find("logged in as %s" % username) tc.find("Logout") tc.url(self.url) tc.notfind(internal_error)
def login(self, username): """Login as the given user""" tc.add_auth("", self.url, username, username) self.go_to_front() tc.find("Login") tc.follow("Login") # We've provided authentication info earlier, so this should # redirect back to the base url. tc.find("logged in as %s" % username) tc.find("Logout") tc.url(self.url) tc.notfind(internal_error)
def login(self, username): """Login as the given user""" username = to_utf8(username) tc.add_auth("", self.url, username, username) self.go_to_front() tc.find("Login") tc.follow(r"\bLogin\b") # We've provided authentication info earlier, so this should # redirect back to the base url. tc.find('logged in as[ \t\n]+<span class="trac-author-user">%s</span>' % username) tc.find("Logout") tc.url(self.url) tc.notfind(internal_error)
def login(self, username): """Login as the given user""" tc.add_auth('', self.url + '/login', username, username) self.go_to_front() tc.find("Login") url = self.url.replace('://', '://{0}:{0}@'.format(unicode_quote(username))) url = '%s/login?referer=%s' % (url, unicode_quote(self.url)) tc.go(url) tc.notfind(internal_error) tc.url(self.url, regexp=False) # We've provided authentication info earlier, so this should # redirect back to the base url. tc.find( 'logged in as[ \t\n]+<span class="trac-author-user">%s</span>' % username) tc.find("Logout") tc.url(self.url, regexp=False) tc.notfind(internal_error)