I have a class:
class AccountBusiness:
def save(self, account) -> Account:
if not account.account_number_is_valid():
retu False
retu True
and a test as :
@mock.patch.object(AccountBusiness, 'save')
def test_can_save_valid_account(self, mock_save):
mock_account = mock.create_autospec(Account)
mock_account.account_number_is_valid.retu_value = False
account_business = AccountBusiness()
result = account_business.save(mock_account)
self.assertEqual(result.retu_value, True)
but it shows an exception like:
AssertionError: <MagicMock name='save()()' id='48830448'> != True
I want to set the retu value of account.account_number_is_valid() to False and run the test.
