def publish_book(publisher):
# some calculations
factor = 4
print('xyz')
db_entry(factor) # db entry call which I want to mock
print('abc')
def update():
publish_book('xyz')
@pytest.mark.django_db
def test_update(mocker):
# in here I'm unable to mock nested function call
pass
I have db_entry() function call in publish_book(). how can we mock db_entry() function call inside publish_book.I want to perform other calculations of publish_book(), but only skip(mock) the db_entry() call.