Commit Graph

310 Commits

Author SHA1 Message Date
Mariusz Felisiak 362813d628
Fixed hanging indentation in various code. 2018-03-16 10:54:34 +01:00
Patryk Zawadzki a20aae414e Fixed #29144 -- Made untranslated strings for territorial language variants use translations from the generic language variant. 2018-03-03 12:08:24 -05:00
Sebastian Sangervasi 7905815510 Fixed #27449 -- Added django.utils.translation.get_supported_language_variant(). 2018-02-23 14:49:00 -05:00
Sebastian Sangervasi 5c4c87e55c Changed "language-code" to the more commonly used "language code". 2018-02-21 09:31:05 -05:00
Sebastian Sangervasi f7b46f0b58 Removed unneeeded inner import in i18n tests. 2018-02-21 08:59:31 -05:00
Chillar Anand e8e0cfa9e5 Fixed #28755 -- Made check_for_language() include apps' locale directories. 2018-02-20 21:34:40 -05:00
Manatsawin Hanmongkolchai 1a1264f149 Fixed #29109 -- Fixed the admin time picker widget for the Thai locale. 2018-02-10 16:05:41 -05:00
Vlastimil Zíma fbc3c29e7c Fixed #29036 -- Fixed HTML5 required validation on SelectDateWidget if the attribute is added by JavaScript.
Thanks Tim Graham for the initial patch.
2018-01-30 19:09:31 -05:00
Jon Dufresne ff05de760c Fixed #29038 -- Removed closing slash from HTML void tags. 2018-01-21 02:09:10 -05:00
Mariusz Felisiak 83a36ac49a
Removed unnecessary trailing commas and spaces in various code. 2017-12-28 21:07:29 +01:00
Claude Paroz 1b7780ea08 Fixed #28544 -- Made unlocalize template filter behave like {% localize off %} tag
Thanks Beda Kosata for the report and Tim Graham for the review.
2017-11-07 20:48:15 +01:00
Claude Paroz c1fa6672dd Refs #28710 -- Simplified l10n format test 2017-10-14 21:07:51 +02:00
Claude Paroz 8c538871bd Fixed #28710 -- Fixed the Basque DATE_FORMAT string
Thanks Eneko Illarramendi for the report and initial patch.
2017-10-13 19:48:20 +02:00
Tom f1c007bbf2 Fixed #28642 -- Added caching to parse_accept_lang_header(). 2017-10-02 14:07:28 -04:00
Tom f04e6732c3 Refs #27804 -- Used subTest() in parse_accept_lang_header() test. 2017-10-02 14:04:52 -04:00
Mads Jensen c0d968ea1f Added a test for TranslatableFile.__eq__(). 2017-09-25 10:22:38 -04:00
Tim Graham 87d2240e6c Refs #27067 -- Removed django.utils.translation.string_concat() per deprecation timeline. 2017-09-22 12:51:17 -04:00
Sjoerd Job Postmus df41b5a05d Fixed #28593 -- Added a simplified URL routing syntax per DEP 0201.
Thanks Aymeric Augustin for shepherding the DEP and patch review.
Thanks Marten Kenbeek and Tim Graham for contributing to the code.
Thanks Tom Christie, Shai Berger, and Tim Graham for the docs.
2017-09-20 18:04:42 -04:00
Tim Graham 116940e3ef Fixed a Dutch translation in i18n tests. 2017-09-14 08:26:38 -04:00
Tim Graham 0c4ac12a7b Fixed #28546 -- Fixed translation's to_locale() with langauge subtags.
Thanks Brent Hand for the initial patch.
2017-09-08 13:46:00 -04:00
Tim Graham 9829b75d5b Added more tests for translation's to_locale(). 2017-09-08 13:43:06 -04:00
Mads Jensen a51c4de194 Used assertRaisesMessage() to test Django's error messages. 2017-07-29 19:07:23 -04:00
Jaap Roes 408ed9fea4 Fixed typo in tests/i18n/tests.py comment. 2017-07-10 12:08:57 -04:00
Tim Graham 0b00a8988b Fixed crash in i18n tests skip condition if gettext isn't installed. 2017-06-29 13:09:16 -04:00
Claude Paroz ceca221b31 Fixed #28304 -- Kept SafeData type for pgettext-translated strings 2017-06-15 21:00:50 +02:00
Claude Paroz a6b5321ce9 Refs #24423 -- Readded inadvertently deleted i18n tests.
Mistake in 97c1931c4f.
2017-06-14 21:34:33 -04:00
Jon Dufresne 2c69824e5a Refs #23968 -- Removed unnecessary lists, generators, and tuple calls. 2017-06-01 19:08:59 -04:00
Tim Graham cde31daf88 Sorted imports per isort 4.2.9. 2017-06-01 13:23:48 -04:00
Ling-Xiao Yang 04ab96ec4f Fixed #28015 -- Added makemessages --add-location option.
Thanks François Freitag for review.
2017-05-22 09:03:53 -04:00
Raphael Michel 504e7782fe Refs #22654 -- Added additional tests and amended release note. 2017-05-05 18:45:07 -04:00
Tim Graham 6b4f018b2b Replaced type-specific assertions with assertEqual().
Python docs say, "it's usually not necessary to invoke these methods directly."
2017-03-17 07:51:48 -04:00
Tim Graham 784a53beef Reverted "Fixed #27878, refs #23919 -- Used python3 shebangs."
This reverts commit 4cffa9a1ff.
2017-03-07 10:10:32 -05:00
Chris Lamb 4cffa9a1ff Fixed #27878, refs #23919 -- Used python3 shebangs. 2017-02-23 13:41:10 -05:00
Claude Paroz 30c984b3f9 Fixed #27868 -- Filtered locale path subdirectories
Thanks Tim Graham for the review.
2017-02-23 09:12:20 +01:00
Claude Paroz c651331b34 Converted usage of ugettext* functions to their gettext* aliases
Thanks Tim Graham for the review.
2017-02-07 09:04:04 +01:00
Tim Graham 29f607927f Fixed spelling of "nonexistent". 2017-02-03 08:01:45 -05:00
Vytis Banaitis 8838d4dd49 Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments. 2017-02-01 11:41:56 -05:00
Claude Paroz 52138b1fd0 Refs #23919 -- Removed usage of obsolete SafeBytes class
The class will be removed as part of #27753.
Thanks Tim Graham for the review.
2017-01-30 15:04:45 +01:00
Tim Graham 1c466994d9 Refs #23919 -- Removed misc Python 2/3 references. 2017-01-25 13:59:25 -05:00
chillaranand d6eaf7c018 Refs #23919 -- Replaced super(ClassName, self) with super(). 2017-01-25 12:23:46 -05:00
Claude Paroz 2366100872 Removed unneeded force_text calls in the test suite 2017-01-24 18:45:54 +01:00
Tim Graham d170c63351 Refs #23919 -- Removed misc references to Python 2. 2017-01-21 20:02:00 -05:00
Tim Graham 7aba69145d Refs #23919 -- Removed django.test.mock Python 2 compatibility shim. 2017-01-20 08:17:20 -05:00
Claude Paroz 042b7350a0 Refs #23919 -- Removed unneeded str() calls 2017-01-20 14:13:55 +01:00
Tim Graham 4e729feaa6 Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.
These functions do nothing on Python 3.
2017-01-20 08:01:02 -05:00
Simon Charette cecc079168 Refs #23919 -- Stopped inheriting from object to define new style classes. 2017-01-19 08:39:46 +01:00
Aymeric Augustin a556396339 Refs #23919 -- Replaced io.open() with open().
io.open() is an alias for open() on Python 3.
2017-01-18 21:45:12 -05:00
Claude Paroz 2b281cc35e Refs #23919 -- Removed most of remaining six usage
Thanks Tim Graham for the review.
2017-01-18 21:33:28 +01:00
Claude Paroz 7b2f2e74ad Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18 20:18:46 +01:00
Claude Paroz c716fe8782 Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
2017-01-18 16:21:28 +01:00
Claude Paroz d7b9aaa366 Refs #23919 -- Removed encoding preambles and future imports 2017-01-18 09:55:19 +01:00
Andy Craze 97c1931c4f Fixed #24423 -- Reorganized i18n tag tests. 2017-01-06 10:33:07 -05:00
Claude Paroz 1206d7fa57 Refs #25753 -- Reset l10n cache when format settings change
Thanks Jaap Roes for the initial patch.
2016-12-21 17:40:08 +01:00
Tim Graham b5f0b3478d Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase. 2016-12-07 17:42:31 -05:00
Keda87 794b7d8033 Refs #27546 -- Tested some __repr__() methods. 2016-12-01 08:09:38 -05:00
Krzysztof Urbaniak b8a815e9df Fixed #27402 -- Fixed incorrect LocaleMiddleware redirects with prefix_default_language=False. 2016-11-29 13:06:35 -05:00
Ramin Farajpour Cami 0a63ef3f61 Fixed #27463 -- Fixed E741 flake8 warnings. 2016-11-14 17:40:28 -05:00
za 321e94fa41 Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings. 2016-11-10 21:30:21 -05:00
Marti Raudsepp b9eb267c46 Skipped makemessages -l tests when xgettext isn't installed. 2016-11-08 17:43:48 -05:00
Krzysztof Urbaniak a01d887a3a Fixed #27063 -- Prevented i18n_patterns() from using too much of the URL as the language. 2016-10-31 14:32:01 -04:00
Krzysztof Urbaniak ee06689878 Added additional tests for translation's get_language_from_path(). 2016-10-31 11:55:24 -04:00
Claude Paroz fa2f55cfd5 Refs #26940 -- Re-allowed makemessages without settings
Thanks Tim Graham for the review.
2016-10-01 14:57:16 +02:00
Jon Dufresne 2c716c1dc7 Fixed #27256 -- Changed Select widget's selected attribute to use HTML5 boolean syntax. 2016-09-21 15:12:13 -07:00
Tim Graham 8119b679eb Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.
http://bugs.python.org/issue27364
2016-09-17 15:44:06 -04:00
Mattias Loverot 2315114090 Fixed #27067 -- Deprecated string_concat() in favor of format_lazy(). 2016-08-25 16:12:40 -04:00
Tim Graham 5a41ca79dc Replaced 'raise SkipTest' with self.skipTest() in a few tests. 2016-08-16 16:42:27 -04:00
Claude Paroz 5fb22b4d4c Fixed #27034 -- Made makemessages independent of USE_I18N
Thanks Tim Graham for the review.
2016-08-11 21:16:19 +02:00
Alex Hill 971120778a
Fixed #26945 -- Ensured that i18n_patterns returns a list 2016-07-24 17:17:00 +02:00
Tobias McNulty 915786785f Fixed #26924 -- Fixed i18n test failure on Mac OS X. 2016-07-21 13:54:35 -04:00
Claude Paroz 3e71f6544f Fixed #26897 -- Fixed makemessages crash on Python 2 with non-ASCII file names
Thanks Tim Graham for the review.
2016-07-14 20:37:56 +02:00
Tim Graham c9ae09addf Replaced use of TestCase.fail() with assertRaises().
Also removed try/except/fail antipattern that hides exceptions.
2016-06-28 11:21:26 -04:00
jasisz b5a1c3a6f5 Fixed #25920 -- Added support for non-uniform NUMBER_GROUPING. 2016-06-22 17:28:49 -04:00
Jon Dufresne 4f336f6652 Fixed #26747 -- Used more specific assertions in the Django test suite. 2016-06-16 14:19:18 -04:00
Tim Graham ac06cb0e56 Removed some blank lines per isort. 2016-06-13 11:45:51 -04:00
Vytis Banaitis 57eb17b8c7 Fixed #26746 -- Fixed handling of zero priority in Accept-Language header parsing. 2016-06-13 07:58:25 -04:00
Vytis Banaitis f1b38842af Fixed #26744 -- Fixed a typo in regex for Accept-Language header parsing. 2016-06-11 21:32:56 -04:00
Ramiro Morales bb7bb379e8 Refs #26677 -- Simplified i18n test cleanups.
The fact that we aren't dealing with the Django source tree anymore
allows us to drop several tearDown()/addCleanup() calls that were
concerned with removing apiece files/dirs/symlinks created by test
cases, as we are covered by the removal of the parent temporary tree
anyways.

Thanks Tim Graham for advice and review.
2016-06-11 13:05:56 -03:00
Ramiro Morales faeeb84edf Fixed #26677 -- Converted some i18n tests to use disposable FS tree.
This allows makemessages/compilemessages tests in `test_extraction.py`
and `test_compilation.py` to actually run isolated from each other
(unaffected by stray FS objects left by cleanup actions failures, debug
sessions, etc.) and to take advantage of the parallel tests execution
feature like most of the Django test suite.

`test_percents.py` gets slightly refactored to not inherit from the new
machinery which sets up every test case to copy and run under a
temporary tree.
2016-06-09 22:03:07 -03:00
Thejaswi Puthraya c8d2120b06 Fixed #26705 -- Fixed plural versions of languages not supported by Django. 2016-06-08 16:17:17 -04:00
Ramiro Morales 71421e8f87 Fixed #26692 -- Relaxed an i18n compilemessages test.
The actual non-ASCII character differs on Windows.
2016-06-01 09:20:57 -04:00
Ramiro Morales e3877c53ed Fixed #26687 -- Made an i18n test not use a hardcoded path separator.
Fixed a failure on Windows.
2016-05-31 12:00:36 -04:00
Ramiro Morales 1b00ed0880 Fixed #26674 -- Corrected a i18n makemessages test.
Made it consistently read the PO file, decode its contents and then
check for the non-breaking space Unicode code point.

Previously we were erroneously skipping the interpretation of what we
read as UTF-8 text.

This was causing the test to fail on Windows with Python 3.5.
2016-05-29 10:31:10 -03:00
Ramiro Morales 15a5755e7c Fixed #26673 -- Fixed a I18N test case error on Windows+Python 2.7.
`subprocess.Popen` doesn't accept enviroment vars with Unicode var name
or value.
2016-05-28 18:05:14 -03:00
Florian Apolloner 9baf692a58 Fixed #26601 -- Improved middleware per DEP 0005.
Thanks Tim Graham for polishing the patch, updating the tests, and
writing documentation. Thanks Carl Meyer for shepherding the DEP.
2016-05-17 07:22:22 -04:00
Claude Paroz 4731e9d82e Fixed #26341 (again) -- Addressed multiple occurrences per line use case 2016-05-02 19:39:56 +02:00
Claude Paroz b16b124996 Fixed #26341 -- Fixed makemessages breaking location comments for HTML files
Thanks Sylvain Garancher for the report and Veranika Sabiashchanskaya for the
initial patch.
2016-04-30 12:08:20 +02:00
Claude Paroz 185f90c45f Adapted _assertPoLocComment for multi-file source lines in po files
Refs #17375.
2016-04-30 12:07:40 +02:00
Jon Dufresne ec6121693f Fixed #22383 -- Added support for HTML5 required attribute on required form fields. 2016-04-21 19:16:38 -04:00
Tim Graham 92053acbb9 Fixed E128 flake8 warnings in tests/. 2016-04-08 10:12:33 -04:00
Krzysztof Urbaniak 85a4844f8a Refs #25933 -- Fixed i18n_patterns() prefix_default_language=False with HTTP_ACCEPT_LANGUAGE header. 2016-03-10 10:51:55 -05:00
Krzysztof Urbaniak 839a955d08 Fixed #25933 -- Allowed an unprefixed default language in i18n_patterns(). 2016-03-08 08:14:10 -05:00
Claude Paroz 95ca01f999 Fixed #26271 -- Fixed i18n_patterns resolution when no language is active
Thanks Marten Kenbeek for the report.
2016-03-07 11:48:11 +01:00
Simon Charette d0451e4cad Fixed #26295 -- Allowed using i18n_patterns() in any root URLconf.
Thanks Tim for the review.
2016-03-03 12:08:49 -05:00
Claude Paroz eda306f1ce Fixed #26232 -- Fixed Popen mocking environment in i18n tests
Refs #25925. Thanks Jeroen Pulles for the report.
2016-02-23 20:06:18 +01:00
Alexey Kotlyarov b59f963ad2 Fixed #26212 -- Made forms.FileField and translation.lazy_number() picklable. 2016-02-15 11:44:29 -05:00
Marcin Markiewicz f7a9872b91 Fixed #26173 -- Prevented localize_input() from formatting booleans as numbers. 2016-02-09 13:07:33 -05:00
Hasan 26ad01719d Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as appropriate. 2016-01-29 13:37:33 -05:00
Hasan 3d0dcd7f5a Refs #26022 -- Used context manager version of assertRaises in tests. 2016-01-29 12:32:18 -05:00
Claude Paroz 104eddbdf6 Fixed #26093 -- Allowed escape sequences extraction by gettext on Python 3
Thanks Sylvain Fankhauser for the report and Tim Graham for the review.
2016-01-23 14:00:55 +01:00
pp b34ff66e5b Added missing period to "etc.". 2016-01-11 18:05:15 -05:00