def test_customer_view_all_accounts_unsuccessful(): # 4.8.1 Account view access manager = AccountManager() account = Account('*****@*****.**') manager.add_account(account) account_data = manager.view_all_accounts('Customer') assert len(account_data) == 0, 'Expected to successfully retrieve all account data'
def test_kitchen_manager_view_all_accounts_success(): # 4.8.1 Account view access manager = AccountManager() account = Account('*****@*****.**') manager.add_account(account) account_data = manager.view_all_accounts('KitchenManager') assert account_data[0].email_address == account.email_address, 'Expected to successfully retrieve all account data'
def test_view_all_accounts_successfully_contains_data(): # 4.8.1.1 Viewable customer information manager = AccountManager() account = Account('*****@*****.**') account.first_name = 'Bob' account.last_name = 'Tan' account.home_address = '56 Robertson Road' account.is_banned = False account.is_locked = False manager.add_account(account) account_data = manager.view_all_accounts('KitchenManager') retrieved_account = account_data[0] assert retrieved_account.first_name == account.first_name, 'Expected first name to match' assert retrieved_account.last_name == account.last_name, 'Expected last name to match' assert retrieved_account.email_address == account.email_address, 'Expected email address to match' assert retrieved_account.home_address == account.home_address, 'Expected home address to match' assert retrieved_account.is_banned == account.is_banned, 'Expected banned status to match' assert retrieved_account.is_locked == account.is_locked, 'Expected locked status to match'