test: fix tests

This commit is contained in:
Taras Lytvynenko
2023-11-14 21:11:16 +02:00
parent 4fa06c0236
commit 13d7945370
2 changed files with 3 additions and 3 deletions

View File

@@ -422,7 +422,7 @@ def get_name_validation_error(name):
if name:
# Validation for the name length
if len(name) > 255:
return _("Full name can`t be longer than 255 symbols")
return _("Full name can't be longer than 255 symbols")
return _('Enter a valid name') if (contains_html(name) or contains_url(name)) else ''
else:

View File

@@ -571,12 +571,12 @@ class TestAccountApi(UserSettingsEventTestMixin, EmailTemplateTagMixin, CreateAc
assert account_settings['country'] is None
assert account_settings['state'] is None
def test_get_name_validation_error_too_long():
def test_get_name_validation_error_too_long(self):
"""
Test validation error when the name is too long.
"""
result = get_name_validation_error("A" * 256)
assert result == 'Full name can`t be longer than 255 symbols'
assert result == "Full name can't be longer than 255 symbols"
@patch('openedx.core.djangoapps.user_api.accounts.image_helpers._PROFILE_IMAGE_SIZES', [50, 10])