diff options
| author | Claude Paroz <claude@2xlibre.net> | 2024-08-27 21:31:07 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2024-08-30 13:39:04 +0200 |
| commit | 2c1f27d0d0346889e3af3b1be03e39e7117b1165 (patch) | |
| tree | e040d3b366798108ce635ad4ea5f36d6192417d0 /tests/i18n | |
| parent | 2ff00251f929cc3e014dd447f6847196e66e69b8 (diff) | |
Dropped safeguards against very old versions of gettext.
gettext 0.19 was released in 2014.
Diffstat (limited to 'tests/i18n')
| -rw-r--r-- | tests/i18n/test_compilation.py | 4 | ||||
| -rw-r--r-- | tests/i18n/test_extraction.py | 27 |
2 files changed, 1 insertions, 30 deletions
diff --git a/tests/i18n/test_compilation.py b/tests/i18n/test_compilation.py index 7da95ba9e9..7b02776dbe 100644 --- a/tests/i18n/test_compilation.py +++ b/tests/i18n/test_compilation.py @@ -8,7 +8,6 @@ from subprocess import run from unittest import mock from django.core.management import CommandError, call_command, execute_from_command_line -from django.core.management.commands.makemessages import Command as MakeMessagesCommand from django.core.management.utils import find_command from django.test import SimpleTestCase, override_settings from django.test.utils import captured_stderr, captured_stdout @@ -269,9 +268,6 @@ class CompilationErrorHandling(MessageCompilationTests): "django.core.management.utils.run", lambda *args, **kwargs: run(*args, env=env, **kwargs), ): - cmd = MakeMessagesCommand() - if cmd.gettext_version < (0, 18, 3): - self.skipTest("python-brace-format is a recent gettext addition.") stderr = StringIO() with self.assertRaisesMessage( CommandError, "compilemessages generated one or more errors" diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py index 226d51ce11..7aa600c4c1 100644 --- a/tests/i18n/test_extraction.py +++ b/tests/i18n/test_extraction.py @@ -6,7 +6,7 @@ import time import warnings from io import StringIO from pathlib import Path -from unittest import mock, skipIf, skipUnless +from unittest import mock, skipUnless from admin_scripts.tests import AdminScriptTestCase @@ -25,10 +25,6 @@ from .utils import POFileAssertionMixin, RunInTmpDirMixin, copytree LOCALE = "de" has_xgettext = find_command("xgettext") -gettext_version = MakeMessagesCommand().gettext_version if has_xgettext else None -requires_gettext_019 = skipIf( - has_xgettext and gettext_version < (0, 19), "gettext 0.19 required" -) @skipUnless(has_xgettext, "xgettext is mandatory for extraction tests") @@ -836,7 +832,6 @@ class LocationCommentsTests(ExtractorTests): self.assertLocationCommentNotPresent(self.PO_FILE, None, ".html.py") self.assertLocationCommentPresent(self.PO_FILE, 5, "templates", "test.html") - @requires_gettext_019 def test_add_location_full(self): """makemessages --add-location=full""" management.call_command( @@ -848,7 +843,6 @@ class LocationCommentsTests(ExtractorTests): self.PO_FILE, "Translatable literal #6b", "templates", "test.html" ) - @requires_gettext_019 def test_add_location_file(self): """makemessages --add-location=file""" management.call_command( @@ -862,7 +856,6 @@ class LocationCommentsTests(ExtractorTests): self.PO_FILE, "Translatable literal #6b", "templates", "test.html" ) - @requires_gettext_019 def test_add_location_never(self): """makemessages --add-location=never""" management.call_command( @@ -871,24 +864,6 @@ class LocationCommentsTests(ExtractorTests): self.assertTrue(os.path.exists(self.PO_FILE)) self.assertLocationCommentNotPresent(self.PO_FILE, None, "test.html") - @mock.patch( - "django.core.management.commands.makemessages.Command.gettext_version", - new=(0, 18, 99), - ) - def test_add_location_gettext_version_check(self): - """ - CommandError is raised when using makemessages --add-location with - gettext < 0.19. - """ - msg = ( - "The --add-location option requires gettext 0.19 or later. You have " - "0.18.99." - ) - with self.assertRaisesMessage(CommandError, msg): - management.call_command( - "makemessages", locale=[LOCALE], verbosity=0, add_location="full" - ) - class NoObsoleteExtractorTests(ExtractorTests): work_subdir = "obsolete_translations" |
