Beispiel #1
0
 def test_language(self):
     r = Request({}, headers={'Accept-Language': 'en-gb;q=0.8, da'})
     bmatch = r.languages_best_match()
     assert ['da', 'en-gb'] == bmatch
Beispiel #2
0
 def test_language_fallback_already_there(self):
     r = Request({}, headers={'Accept-Language': 'en-gb;q=0.8, it, da'})
     bmatch = r.languages_best_match(fallback='it')
     assert ['it'] == bmatch, bmatch
Beispiel #3
0
 def test_language_fallback(self):
     r = Request({}, headers={'Accept-Language': 'en-gb;q=0.8, da'})
     bmatch = r.languages_best_match(fallback='it')
     assert ['da', 'en-gb', 'it'] == bmatch
Beispiel #4
0
 def test_language(self):
     r = Request({}, headers={'Accept-Language': 'en-gb;q=0.8, da'})
     bmatch = r.languages_best_match()
     assert ['da', 'en-gb'] == bmatch
Beispiel #5
0
 def test_language_fallback_already_there(self):
     r = Request({}, headers={'Accept-Language': 'en-gb;q=0.8, it, da'})
     bmatch = r.languages_best_match(fallback='it')
     assert bmatch[-1] == 'it', bmatch
Beispiel #6
0
 def test_language_fallback(self):
     r = Request({}, headers={'Accept-Language': 'en-gb;q=0.8, da'})
     bmatch = r.languages_best_match(fallback='it')
     assert ['da', 'en-gb', 'it'] == bmatch