def mock_verify_token(testcase):
 patcher = mock.patch('db.Journalist.verify_token')
 testcase.addCleanup(patcher.stop)
 testcase.mock_journalist_verify_token = patcher.start()
 testcase.mock_journalist_verify_token.return_value = True

def mock_verify_token ( testcase ) : patcher = mock . patch ( 'db.Journalist.verify_token' ) testcase . addCleanup ( patcher . stop ) testcase . mock_journalist_verify_token = patcher . start ( ) testcase . mock_journalist_verify_token . return_value = True
patch a :class:unittest .