'The set_language view returns 204 for AJAX calls by default.'

def test_setlang_doesnt_perform_a_default_redirect_for_ajax(self):

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