summaryrefslogtreecommitdiff
path: root/tests/utils_tests
AgeCommit message (Collapse)Author
2014-12-27[1.7.x] Fixed #23831 -- Supported strings escaped by third-party libs in Django.Aymeric Augustin
Refs #7261 -- Made strings escaped by Django usable in third-party libs. The changes in mark_safe and mark_for_escaping are straightforward. The more tricky part is to handle correctly objects that implement __html__. Historically escape() has escaped SafeData. Even if that doesn't seem a good behavior, changing it would create security concerns. Therefore support for __html__() was only added to conditional_escape() where this concern doesn't exist. Then using conditional_escape() instead of escape() in the Django template engine makes it understand data escaped by other libraries. Template filter |escape accounts for __html__() when it's available. |force_escape forces the use of Django's HTML escaping implementation. Here's why the change in render_value_in_context() is safe. Before Django 1.7 conditional_escape() was implemented as follows: if isinstance(text, SafeData): return text else: return escape(text) render_value_in_context() never called escape() on SafeData. Therefore replacing escape() with conditional_escape() doesn't change the autoescaping logic as it was originally intended. This change should be backported to Django 1.7 because it corrects a feature added in Django 1.7. Thanks mitsuhiko for the report. Backport of 6d52f6f from master.
2014-12-27[1.7.x] Fixed an inconsistency introduced in 547b1810.Aymeric Augustin
mark_safe and mark_for_escaping should have been kept similar. On Python 2 this change has no effect. On Python 3 it fixes the use case shown in the regression test for mark_for_escaping, which used to raise a TypeError. The regression test for mark_safe is just for completeness. Backport of 5c5eb5fe from master.
2014-12-22[1.7.x] Fixed #23998 -- Added datetime.time support to migrations questioner.Oscar Ramirez
Backport of 54085b0f9ba7d9f705f9b9c90d3433b0ef6aa042 from master
2014-10-08[1.7.x] Fixed #23333 -- Made urlsafe_base64_decode() return proper type on ↵Ian Foote
Python 3. Backport of 03d89168a2 from master
2014-07-30[1.7.x] Fixed test failure on Windows.Tim Graham
os.close(fd) is needed to avoid "The process cannot access the file because it is being used by another process" Backport of c2ab501bab from master
2014-07-25[1.7.x] Fixed bad usage of rstrip() that caused test failure.Tim Graham
If the temporary file name contained a p or y as its last characters, it would be stripped. refs #23083. Backport of 57d2b3f2a7 from master
2014-07-25[1.7.x] Fixed #23083 -- Fixed runserver reloading when deleting a file.Tim Graham
Thanks Collin Anderson for the report and hirokiky for the fix. Backport of b8cb5ba708 from master
2014-07-15[1.7.x] Fixed #22991 -- Prevented *.pyc files in autoreload monitoringClaude Paroz
This fixes a regression introduced in 6d302f639. Thanks lorinkoz at gmail.com for the report, Collin Anderson for the initial patch and Simon Charette for the review. Backport of 4e424084e from master.
2014-07-07[1.7.x] Fixed flake8 errors.Tim Graham
Backport of fddd95254e from master
2014-07-07[1.7.x] Fixed #22909 -- Removed camelCasing in some tests.Tim Graham
Thanks brylie. Backport of 89b9e6e5d6 from master
2014-07-06[1.7.x] Fixed pyinotify performance regression in 15f82c7011Claude Paroz
Refs #9722. Thanks Tim Graham for the review. Backport of 6d302f639 from master.
2014-06-25[1.7.x] Fixed #22814 -- Allowed ISO-8601 [+-]hh timezone format in ↵Richard Eames
parse_datetime Backport of 7beaeeed from master.
2014-06-03[1.7.x] Fixed #22681 -- Made TarArchive recognize leading directories properly.Alexandr Shurigin
Backport of 083d285b82 from master
2014-05-17[1.7.x] Fixed several flake8 errors, including one where a test wouldn't be runAlex Gaynor
Backport of b6b873d2ada0d7c2a616d11f161a7688df15f45f from master
2014-05-16[1.7.x] Optimized make_aware/naive by removing redundant checks. Refs #22625.Aymeric Augustin
Also added tests with pytz and removed misplaced tests. Backport of 1109ebd from master
2014-05-16[1.7.x] Fixed #22625 -- Normalized make_aware/naive errors.Aymeric Augustin
Also added tests for is/make_aware/naive. Thanks Tom Michaelis for the report. Backport of fa89acf from master
2014-05-15[1.7.x] Harmonized some PEP 0263 coding preamblesClaude Paroz
Backport of e520a73ee from master.
2014-05-14[1.7.x] Added additional checks in is_safe_url to account for flexible parsing.Erik Romijn
This is a security fix. Disclosure following shortly.
2014-05-14[1.7.x] Dropped fix_IE_for_vary/attach.Aymeric Augustin
This is a security fix. Disclosure following shortly.
2014-03-30[1.7.x] Fixed #22338 -- Fixed a test dependent on dictionary key iteration ↵Tim Graham
order. Backport of 69a4f383f6 from master
2014-03-27[1.7.x] Fixed a deprecation warning on Python 3.Tim Graham
Backport of c19bbefca2 from master
2014-03-22[1.7.x] Tweaked strip_tags tests to pass on Python 3.3Claude Paroz
Backport of 6a0291bdaf from master.
2014-03-22[1.7.x] Improved strip_tags and clarified documentationClaude Paroz
The fact that strip_tags cannot guarantee to really strip all non-safe HTML content was not clear enough. Also see: https://www.djangoproject.com/weblog/2014/mar/22/strip-tags-advisory/ Backport of 6ca6c36f82b from master.
2014-03-13Fixed #21840 -- Moved dunder methods from SimpleLazyObject to LazyObject.Baptiste Mispelon
This commit also added tests for LazyObject and refactored the testsuite of SimpleLazyObject so that it can share test cases with LazyObject.
2014-03-08Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
2014-03-05Really hidden warnings in javascript_quote testsClaude Paroz
Refs #21725.
2014-03-01Fixed #22130 -- Deprecated fix_ampersands, removed utils.clean_html()Erik Romijn
2014-02-22Deprecated django.utils.text.javascript_quote.Baptiste Mispelon
Refs #21725.
2014-02-22Fixed test failures when running in a narrow Python build.Baptiste Mispelon
2014-02-15Fixed #21725 -- Fixed JavaScript quoting encoding.MattBlack85
Thanks to nedbatchelder for the report.
2014-02-08Fixed #21674 -- Deprecated the import_by_path() function in favor of ↵Berker Peksag
import_string(). Thanks Aymeric Augustin for the suggestion and review.
2014-02-06Fixed #21731 -- Made javascript_quote escapes '</'.Vajrasky Kok
2014-02-05Removed import which is now unusedAlex Gaynor
2014-02-05Revert "Fixed #20296 -- Allowed SafeData and EscapeData to be lazy"Baptiste Mispelon
This reverts commit 2ee447fb5f8974b432d3dd421af9a242215aea44. That commit introduced a regression (#21882) and didn't really do what it was supposed to: while it did delay the evaluation of lazy objects passed to mark_safe(), they weren't actually marked as such so they could end up being escaped twice. Refs #21882.
2014-01-25Moved sys.path-extending decorator to django.test.utils and used throughout ↵Carl Meyer
test suite. Thanks Aymeric for the suggestion.
2014-01-12Fixed #21756 -- Skipped two timezone-related tests on Windows.Aymeric Augustin
Windows cannot use a time zone other than the default time zone. Thanks manfre for the report.
2013-12-23Imported override_settings from its new location.Aymeric Augustin
2013-12-23Dropped AppCache._empty, _with_app and _without_app.Aymeric Augustin
It's now easier to achieve the same effect with modify_settings or override_settings.
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-22Expurged INSTALLED_APPS from code and tests.Aymeric Augustin
Except the app cache code and a few specific tests, of course.
2013-12-22Stopped iterating on INSTALLED_APPS.Aymeric Augustin
Used the app cache's get_app_configs() method instead.
2013-12-14Fixed E127 pep8 warnings.Loic Bistuer
2013-12-12Fixed #21574 -- Handle bytes consistently in utils.text.normalize_newlines.Baptiste Mispelon
All input is now coerced to text before being normalized. This changes nothing under Python 2 but it allows bytes to be passed to the function without a TypeError under Python3 (bytes are assumed to be utf-8 encoded text). Thanks to trac user vajrasky for the report.
2013-12-07Fixed #21572 -- Added unit test for django.utils.text.normalize_newlines.Vajrasky Kok
2013-11-24Fixed #21505 -- Added unit test for django.utils.text.get_valid_filename.Vajrasky Kok
2013-11-11Fixed #9523 -- Restart runserver after compiling apps translationsBouke Haarsma
Django also uses locales provided by apps, which also might change. Also when i18n is disabled, there is no need for watching translation files.
2013-11-03Fixed all E226 violationsAlex Gaynor
2013-11-02Fixing E302 ErrorsJason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-11-02Fixed #21302 -- Fixed unused imports and import *.Tim Graham
2013-11-02Fixed #9523 -- Restart runserver after translation MO files changeBouke Haarsma
Thanks to Krzysztof Kulewski for the initial patch.