Rehabilitate test coverage in ussd and cic-notify
This commit is contained in:
@@ -14,7 +14,7 @@ class Cache:
|
||||
store: Redis = None
|
||||
|
||||
|
||||
def cache_data(key: str, data: str):
|
||||
def cache_data(key: str, data: [bytes, float, int, str]):
|
||||
"""
|
||||
:param key:
|
||||
:type key:
|
||||
|
||||
@@ -63,10 +63,7 @@ class Account(SessionBase):
|
||||
def remove_guardian(self, phone_number: str):
|
||||
set_guardians = self.guardians.split(',')
|
||||
set_guardians.remove(phone_number)
|
||||
if len(set_guardians) > 1:
|
||||
self.guardians = ','.join(set_guardians)
|
||||
else:
|
||||
self.guardians = set_guardians[0]
|
||||
self.guardians = ','.join(set_guardians)
|
||||
|
||||
def get_guardians(self) -> list:
|
||||
return self.guardians.split(',') if self.guardians else []
|
||||
|
||||
@@ -7,3 +7,4 @@ from .custom import CustomMetadata
|
||||
from .person import PersonMetadata
|
||||
from .phone import PhonePointerMetadata
|
||||
from .preferences import PreferencesMetadata
|
||||
from .tokens import TokenMetadata
|
||||
|
||||
@@ -417,7 +417,7 @@ class MenuProcessor:
|
||||
preferred_language = get_cached_preferred_language(self.account.blockchain_address)
|
||||
if not preferred_language:
|
||||
preferred_language = i18n.config.get('fallback')
|
||||
return translation_for(self.display_key,preferred_language,token_symbol=token_symbol)
|
||||
return translation_for(self.display_key, preferred_language, token_symbol=token_symbol)
|
||||
|
||||
def exit_successful_transaction(self):
|
||||
"""
|
||||
|
||||
@@ -87,7 +87,7 @@ def is_valid_guardian_addition(state_machine_data: Tuple[str, dict, Account, Ses
|
||||
guardianship = Guardianship()
|
||||
is_system_guardian = guardianship.is_system_guardian(phone_number)
|
||||
is_initiator = phone_number == account.phone_number
|
||||
is_existent_guardian = phone_number in account.get_guardians()
|
||||
is_existent_guardian = phone_number in account.get_guardians() or is_system_guardian
|
||||
|
||||
failure_reason = ''
|
||||
if not is_valid_account:
|
||||
|
||||
Reference in New Issue
Block a user