Account test suite implementation

darcs-hash:20061123180515-86b55-fd6db5bd3cba07f2a3d5987d4c92c07f7ec32c5e.gz
This commit is contained in:
David Rousselie
2006-11-23 19:05:15 +01:00
parent 4eabef61f6
commit 8b4ec434ac
3 changed files with 18 additions and 11 deletions

View File

@@ -644,7 +644,7 @@ class JCLComponent(Component, object):
reg_form.fields["name"].value = _account.name
reg_form.fields["name"].type = "hidden"
for (field_name, field) in reg_form.fields.items():
if hasattr(self.account_class, field_name):
if hasattr(_account, field_name):
field.value = str(getattr(_account, field_name))
return reg_form

View File

@@ -100,12 +100,12 @@ class Account(SQLObject):
def set_status(self, status):
"""Set current Jabber status"""
if status == OFFLINE:
if hasattr(self.__class__, 'waiting_password_reply') \
and hasattr(self.__class__, 'store_password') \
and hasattr(self.__class__, 'password'):
setattr(self.__class__, 'waiting_password_reply', False)
if not getattr(self.__class__, 'store_password'):
setattr(self.__class__, 'password', None)
if hasattr(self, 'waiting_password_reply') \
and hasattr(self, 'store_password') \
and hasattr(self, 'password'):
setattr(self, 'waiting_password_reply', False)
if not getattr(self, 'store_password'):
setattr(self, 'password', None)
else:
# TODO seems to be a bug : first_check = True only
# if previous status was OFFLINE