def METHOD_NAME(self, accounts=(), expected=(), mail=None, header_priority=None,
          force_realname=False, force_address=False):
    """This method collects most of the steps that need to be done for most
    tests.  Especially a closure to mock settings.get and a mock for
    settings.get_accounts are set up."""
    mail = self.mail if mail is None else mail
    header_priority = self.header_priority if header_priority is None \
        else header_priority
    def settings_get(arg):
        """Mock function for setting.get()"""
        if arg == "reply_account_header_priority":
            return header_priority
        elif arg.endswith('_force_realname'):
            return force_realname
        elif arg.endswith('_force_address'):
            return force_address
    with mock.patch('alot.commands.thread.settings.get_accounts',
                    mock.Mock(return_value=accounts)):
        with mock.patch('alot.commands.thread.settings.get', settings_get):
            actual = thread.determine_sender(mail)
    self.assertTupleEqual(actual, expected)