def attach_mock(self, mock, attribute):
mock._mock_parent = None<EOL>mock._mock_new_parent = None<EOL>mock._mock_name = '<STR_LIT>'<EOL>mock._mock_new_name = None<EOL>setattr(self, attribute, mock)<EOL>
Attach a mock as an attribute of this one, replacing its name and
parent. Calls to the attached mock will be recorded in the
`method_calls` and `mock_calls` attributes of this one.