'The set_language view can be used to change the session language.
The user is redirected to the \'next\' argument if provided.'

def test_setlang(self):

    for (lang_code, lang_name) in settings.LANGUAGES:
        post_data = dict(language=lang_code, next='/views/')
        response = self.client.post('/views/i18n/setlang/', data=post_data)
        self.assertRedirects(response, 'http://testserver/views/')
        self.assertEqual(self.client.session['django_language'], lang_code)
