#28567: Set Language Redirect View -> 404 if prefix_default_language=False
-------------------------------------+-------------------------------------
Reporter: George Tantiras | Owner: nobody
Type: Bug | Status: new
Component: | Version: 1.11
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by George Tantiras):
I have written a test class in my project, for the time being. It is a
challenge to integrate it to Django, so I am pasting it here until then:
{{{
from django.test import TestCase
class setlangTest(TestCase):
def test_en2gr(self):
response = self.client.post(
'/i18n/setlang/',
data={'language': 'el'},
follow=False,
HTTP_REFERER='/admin/',
)
self.assertEqual(response.url, '/el/admin/', 'Did not change from
English to Greek')
def test_gr2en(self):
response = self.client.post(
'/i18n/setlang/',
data={'language': 'en'},
follow=False,
HTTP_REFERER='/el/admin/',
)
self.assertEqual(response.url, '/admin/', 'Did not change from
Greek to English')
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28567#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.3181f68a9f390798466aa2651690a989%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.