'The fallback to root URL for the set_language view works for AJAX calls.'

def test_setlang_unsafe_next_for_ajax(self):

    lang_code = self._get_inactive_language_code()
    post_data = {'language': lang_code, 'next': '//unsafe/redirection/'}
    response = self.client.post('/i18n/setlang/', post_data, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    self.assertEqual(response.url, '/')
    self.assertEqual(self.client.session[LANGUAGE_SESSION_KEY], lang_code)
