[#927] Sets default language to en-US
authorAnike Arni <aarni@thoughtworks.com>
Thu, 20 Apr 2017 12:32:45 +0000 (09:32 -0300)
committerAnike Arni <aarni@thoughtworks.com>
Thu, 20 Apr 2017 12:32:45 +0000 (09:32 -0300)
with @deniscostadsc

service/pixelated/support/language.py
service/test/unit/resources/test_login_resource.py
service/test/unit/support/test_language.py

index 4999bc0..cd455f8 100644 (file)
@@ -21,4 +21,4 @@ def parse_accept_language(all_headers):
     for language in accepted_languages:
         if language in languages:
             return language
     for language in accepted_languages:
         if language in languages:
             return language
-    return 'pt-BR'
+    return 'en-US'
index e33b561..03d6175 100644 (file)
@@ -231,7 +231,7 @@ class TestLoginPOST(unittest.TestCase):
         d = self.web.get(self.request)
 
         def assert_login_setup_service_for_user(_):
         d = self.web.get(self.request)
 
         def assert_login_setup_service_for_user(_):
-            mock_user_bootstrap_setup.assert_called_once_with(self.user_auth, self.password, 'pt-BR')
+            mock_user_bootstrap_setup.assert_called_once_with(self.user_auth, self.password, 'en-US')
 
         d.addCallback(assert_login_setup_service_for_user)
         return d
 
         d.addCallback(assert_login_setup_service_for_user)
         return d
index 23983b5..b84f3a2 100644 (file)
@@ -33,8 +33,8 @@ class TestParseAcceptLanguage(unittest.TestCase):
         parsed_language = parse_accept_language(all_headers)
         self.assertEqual('en-US', parsed_language)
 
         parsed_language = parse_accept_language(all_headers)
         self.assertEqual('en-US', parsed_language)
 
-    def test_parse_pt_br_as_default(self):
+    def test_parse_en_us_as_default(self):
         all_headers = {
             'accept-language': 'de-DE,de;q=0.8,en-US;q=0.5,en;q=0.3'}
         parsed_language = parse_accept_language(all_headers)
         all_headers = {
             'accept-language': 'de-DE,de;q=0.8,en-US;q=0.5,en;q=0.3'}
         parsed_language = parse_accept_language(all_headers)
-        self.assertEqual('pt-BR', parsed_language)
+        self.assertEqual('en-US', parsed_language)