'Verification obj and tmp_id should be set in frappe.local.'

def test_authenticate_for_2factor(self):

    authenticate_for_2factor(self.user)
    verification_obj = frappe.local.response[u'verification']
    tmp_id = frappe.local.response[u'tmp_id']
    self.assertTrue(verification_obj)
    self.assertTrue(tmp_id)
    for k in [u'_usr', u'_pwd', u'_otp_secret']:
        self.assertTrue(frappe.cache().get(u'{0}{1}'.format(tmp_id, k)), u'{}    not    available'.format(k))
