fix when username/password is invalid

This commit is contained in:
Romain Bignon 2011-02-07 15:37:02 +01:00
commit 248b808206

View file

@ -55,7 +55,7 @@ class RedmineBrowser(BaseBrowser):
BaseBrowser.__init__(self, *args, **kwargs)
def is_logged(self):
return self.page and len(self.page.document.getroot().cssselect('a.my-account')) == 1
return self.is_on_page(LoginPage) or self.page and len(self.page.document.getroot().cssselect('a.my-account')) == 1
def login(self):
assert isinstance(self.username, basestring)