3
3
4
4
from django .conf import settings
5
5
from django .test .utils import override_settings
6
- from django .utils .translation import ugettext
6
+ from django .utils .translation import gettext
7
7
8
8
from germanium .decorators import data_consumer
9
9
from germanium .tools .trivials import assert_in , assert_equal , assert_not_equal
@@ -440,7 +440,7 @@ def test_should_raise_bad_request_with_invalid_filename(self, number, data):
440
440
assert_in ('contract' , errors )
441
441
assert_equal (
442
442
errors ['contract' ],
443
- ugettext ('Content type cannot be evaluated from input data please send it' )
443
+ gettext ('Content type cannot be evaluated from input data please send it' )
444
444
)
445
445
446
446
@data_consumer ('get_users_data' )
@@ -454,7 +454,7 @@ def test_should_raise_bad_request_if_file_content_is_not_in_base64(self, number,
454
454
assert_http_bad_request (resp )
455
455
errors = self .deserialize (resp ).get ('messages' , {}).get ('errors' )
456
456
assert_in ('contract' , errors )
457
- assert_equal (errors ['contract' ]['content' ], ugettext ('File content must be in base64 format' ))
457
+ assert_equal (errors ['contract' ]['content' ], gettext ('File content must be in base64 format' ))
458
458
459
459
@data_consumer ('get_users_data' )
460
460
def test_should_raise_bad_request_if_url_is_not_valid (self , number , data ):
@@ -466,7 +466,7 @@ def test_should_raise_bad_request_if_url_is_not_valid(self, number, data):
466
466
assert_http_bad_request (resp )
467
467
errors = self .deserialize (resp ).get ('messages' , {}).get ('errors' )
468
468
assert_in ('contract' , errors )
469
- assert_equal (errors ['contract' ]['url' ], ugettext ('Enter a valid URL.' ))
469
+ assert_equal (errors ['contract' ]['url' ], gettext ('Enter a valid URL.' ))
470
470
471
471
@data_consumer ('get_users_data' )
472
472
def test_should_raise_bad_request_if_required_items_are_not_provided (self , number , data ):
@@ -477,7 +477,7 @@ def test_should_raise_bad_request_if_required_items_are_not_provided(self, numbe
477
477
assert_http_bad_request (resp )
478
478
errors = self .deserialize (resp ).get ('messages' , {}).get ('errors' )
479
479
assert_in ('contract' , errors )
480
- msg = ugettext ('File data item must contains {} or {}' ).format (
480
+ msg = gettext ('File data item must contains {} or {}' ).format (
481
481
', ' .join (REQUIRED_ITEMS ), ', ' .join (REQUIRED_URL_ITEMS )
482
482
)
483
483
assert_equal (errors ['contract' ], msg )
@@ -493,7 +493,7 @@ def test_should_raise_bad_request_if_file_is_unreachable(self, number, data):
493
493
assert_http_bad_request (resp )
494
494
errors = self .deserialize (resp ).get ('messages' , {}).get ('errors' )
495
495
assert_in ('contract' , errors )
496
- assert_equal (errors ['contract' ]['url' ], ugettext ('File is unreachable on the URL address' ))
496
+ assert_equal (errors ['contract' ]['url' ], gettext ('File is unreachable on the URL address' ))
497
497
498
498
@override_settings (PYSTON_FILE_SIZE_LIMIT = 10 )
499
499
@data_consumer ('get_users_data' )
@@ -509,7 +509,7 @@ def test_should_raise_bad_request_if_response_is_too_large(self, number, data):
509
509
assert_http_bad_request (resp )
510
510
errors = self .deserialize (resp ).get ('messages' , {}).get ('errors' )
511
511
assert_in ('contract' , errors )
512
- msg = ugettext ('Response too large, maximum size is {} bytes' ).format (pyston_settings .FILE_SIZE_LIMIT )
512
+ msg = gettext ('Response too large, maximum size is {} bytes' ).format (pyston_settings .FILE_SIZE_LIMIT )
513
513
assert_equal (errors ['contract' ]['url' ], msg )
514
514
515
515
@data_consumer ('get_users_data' )
0 commit comments