def test_shell_account_when_it_doesnt_exists(self, account_mock): with patch.object(db, 'session'): account = shell_account() assert account.name == 'system' db.session.add.assert_called_once_with(account)
def test_shell_account_when_it_doesnt_exists(self, account_mock): with h.patch.object(db, 'session'): account = shell_account() assert account.name == 'system' db.session.add.assert_called_once_with(account)
def test_shell_account_when_it_exists(self, account_mock): assert shell_account() == 'the account' Account.by_name.assert_called_once_with('system')