mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	python: Modernize legacy Python 2 syntax with pyupgrade.
Generated by `pyupgrade --py3-plus --keep-percent-format` on all our Python code except `zthumbor` and `zulip-ec2-configure-interfaces`, followed by manual indentation fixes. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							fff2d3958a
						
					
				
				
					commit
					c734bbd95d
				
			@@ -1,5 +1,3 @@
 | 
			
		||||
# -*- coding: utf-8 -*-
 | 
			
		||||
 | 
			
		||||
from typing import Any
 | 
			
		||||
 | 
			
		||||
import mock
 | 
			
		||||
@@ -73,10 +71,10 @@ class TranslationTestCase(ZulipTestCase):
 | 
			
		||||
        return response
 | 
			
		||||
 | 
			
		||||
    def test_accept_language_header(self) -> None:
 | 
			
		||||
        languages = [('en', u'Sign up'),
 | 
			
		||||
                     ('de', u'Registrieren'),
 | 
			
		||||
                     ('sr', u'Упишите се'),
 | 
			
		||||
                     ('zh-hans', u'注册'),
 | 
			
		||||
        languages = [('en', 'Sign up'),
 | 
			
		||||
                     ('de', 'Registrieren'),
 | 
			
		||||
                     ('sr', 'Упишите се'),
 | 
			
		||||
                     ('zh-hans', '注册'),
 | 
			
		||||
                     ]
 | 
			
		||||
 | 
			
		||||
        for lang, word in languages:
 | 
			
		||||
@@ -85,10 +83,10 @@ class TranslationTestCase(ZulipTestCase):
 | 
			
		||||
            self.assert_in_response(word, response)
 | 
			
		||||
 | 
			
		||||
    def test_cookie(self) -> None:
 | 
			
		||||
        languages = [('en', u'Sign up'),
 | 
			
		||||
                     ('de', u'Registrieren'),
 | 
			
		||||
                     ('sr', u'Упишите се'),
 | 
			
		||||
                     ('zh-hans', u'注册'),
 | 
			
		||||
        languages = [('en', 'Sign up'),
 | 
			
		||||
                     ('de', 'Registrieren'),
 | 
			
		||||
                     ('sr', 'Упишите се'),
 | 
			
		||||
                     ('zh-hans', '注册'),
 | 
			
		||||
                     ]
 | 
			
		||||
 | 
			
		||||
        for lang, word in languages:
 | 
			
		||||
@@ -100,10 +98,10 @@ class TranslationTestCase(ZulipTestCase):
 | 
			
		||||
            self.assert_in_response(word, response)
 | 
			
		||||
 | 
			
		||||
    def test_i18n_urls(self) -> None:
 | 
			
		||||
        languages = [('en', u'Sign up'),
 | 
			
		||||
                     ('de', u'Registrieren'),
 | 
			
		||||
                     ('sr', u'Упишите се'),
 | 
			
		||||
                     ('zh-hans', u'注册'),
 | 
			
		||||
        languages = [('en', 'Sign up'),
 | 
			
		||||
                     ('de', 'Registrieren'),
 | 
			
		||||
                     ('sr', 'Упишите се'),
 | 
			
		||||
                     ('zh-hans', '注册'),
 | 
			
		||||
                     ]
 | 
			
		||||
 | 
			
		||||
        for lang, word in languages:
 | 
			
		||||
@@ -125,7 +123,7 @@ class JsonTranslationTestCase(ZulipTestCase):
 | 
			
		||||
        result = self.client_post("/json/invites",
 | 
			
		||||
                                  HTTP_ACCEPT_LANGUAGE='de')
 | 
			
		||||
 | 
			
		||||
        expected_error = u"this arg is bad: 'invitee_emails' (translated to German)"
 | 
			
		||||
        expected_error = "this arg is bad: 'invitee_emails' (translated to German)"
 | 
			
		||||
        self.assert_json_error_contains(result,
 | 
			
		||||
                                        expected_error,
 | 
			
		||||
                                        status_code=400)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user