Commit Graph

20247 Commits

Author SHA1 Message Date
Michael Angeletti 65441bbdb0 Fixed #24391 -- Made BoundField.value() cache callable values. 2015-02-24 19:50:55 -05:00
Tim Graham d298b1ba50 Reverted "Fixed #24325 -- Documented change in ModelForm.save() foreign key access."
This reverts commit 0af3822dc3.
It's obsoleted by refs #24395.
2015-02-24 11:50:21 -05:00
Stanislas Guerra 4c2f546b55 Fixed #24395 -- Ensured inline ModelsForms have an updated related instance. 2015-02-24 11:49:00 -05:00
Preston Timmons 8e129b42ad Cleaned up template directory handling in template tests. 2015-02-24 14:00:03 +01:00
Preston Timmons 32c108a221 Combined TemplateTests and TemplateRegressionTests. 2015-02-24 14:00:03 +01:00
Preston Timmons 25a0b5cdcd Moved test_token_smart_split into ParserTests. 2015-02-24 14:00:03 +01:00
Preston Timmons 3d8fee6051 Moved ifchanged tests into syntax_tests/test_if_changed.py. 2015-02-24 14:00:02 +01:00
Preston Timmons f6d087b628 Moved cache tests into syntax_tests/test_cache.py. 2015-02-24 14:00:02 +01:00
Preston Timmons 250a3d1993 Moved RequestContextTests into test_context. 2015-02-24 14:00:02 +01:00
Preston Timmons ff67ce5076 Moved TemplateTagLoading cases into test_custom. 2015-02-24 14:00:02 +01:00
Preston Timmons 06ffc764a9 Moved include tests into syntax_tests/test_include.py. 2015-02-24 14:00:02 +01:00
Preston Timmons 441a47e1ef Moved ssi tests into syntax_tests/test_ssi.py. 2015-02-24 14:00:02 +01:00
Preston Timmons 1827aa9024 Cleaned up template loader tests. 2015-02-24 14:00:02 +01:00
Nik Nyby 2be6b52656 Fixed typos in flatpages_tests comments. 2015-02-24 06:30:33 -05:00
Aymeric Augustin 903d1a57ab Made migrations tests write to a temporary directory.
This is preferrable to writing in the current working directory because
it eliminates the risk to leak unwanted files, which can result in very
weird test failures.

Also this will help if we ever try to run these tests concurrently.
2015-02-23 22:22:58 +01:00
Aymeric Augustin b9c619abc1 Prevented makemigrations from writing in sys.path[0].
There's no reason to assume that sys.path[0] is an appropriate location
for generating code. Specifically that doesn't work with extend_sys_path
which puts the additional directories at the end of sys.path.

In order to create a new migrations module, instead of using an
arbitrary entry from sys.path, import as much as possible from the path
to the module, then create missing submodules from there.

Without this change, the tests introduced in the following commit fail,
which seems sufficient to prevent regressions for such a refactoring.
2015-02-23 19:55:10 +01:00
Aymeric Augustin 952ce778c6 Fixed a test failure under Windows and Python 2. 2015-02-23 18:36:15 +01:00
Aymeric Augustin a8fe12417f Normalized usage of the tempfile module.
Specifically stopped using the dir argument.
2015-02-23 16:55:27 +01:00
Aymeric Augustin 934400759d Guaranteed removal of temporary files during tests.
Dropped the DJANGO_TEST_TEMP_DIR environment variable.

Before this change, proper removal depended on the developer passing
dir=os.environ['DJANGO_TEST_TMP_DIR'] to tempfile functions.
2015-02-23 16:55:26 +01:00
Kenneth Kam e83aba0e2c Fixed #23762 -- clarified CACHE_MIDDLEWARE_ANONYMOUS_ONLY deprecation in docs 2015-02-23 09:23:07 -05:00
Tim Graham 1306cd1e8a Fixed #24377 -- Fixed model inline formsets with primary key's that have defaults. 2015-02-23 08:44:27 -05:00
Ian Lee 00fbd8fd52 Broke long lines in code examples.
The website only renders code blocks at 96 chars, and therefore
long code lines get wrapped. Manually breaking the lines prevents
the wrapping from occurring.
2015-02-23 07:45:37 -05:00
Emin Mastizada dda2a3cf4c Added formats for the Azerbaijani locale. 2015-02-23 07:37:13 -05:00
Anssi Kääriäinen f95122e541 Fixed #24381 -- removed ForeignObjectRel opts and to_opts
These cached properies were causing problems with pickling, and in
addition they were confusingly defined: field.rel.model._meta was
not the same as field.rel.opts.

Instead users should use field.rel.related_model._meta inplace of
field.rel.opts, and field.rel.to._meta in place of field.rel.to_opts.
2015-02-23 07:24:43 -05:00
Marten Kenbeek 78d43a5e10 Fixed #24366 -- Optimized traversal of large migration dependency graphs.
Switched from an adjancency list and uncached, iterative depth-first
search to a Node-based design with direct parent/child links and a
cached, recursive depth-first search. With this change, calculating
a migration plan for a large graph takes several seconds instead of
several hours.

Marked test `migrations.test_graph.GraphTests.test_dfs` as an expected
failure due to reaching the maximum recursion depth.
2015-02-23 12:38:53 +01:00
Michael Manfre 7fa7dd48c4 Fixed signature of BaseDatabaseOperations.date_interval_sql() and document the change. 2015-02-22 23:23:16 -05:00
Aymeric Augustin 556a74879f Fixed a few uses of Template that relied on a default engine.
Refs #24389.
2015-02-22 23:13:55 +01:00
Aymeric Augustin c688460df6 Removed rmtree_errorhandler.
The stated reason for its introduction in d18d37ce no longer applies
since Django's code repository was switched from Subversion to git.

Furthermore it never had any effect because shutil.rmtree ignores its
onerror argument when ignore_errors is True.

The reason for its use in template management commands is unclear.
2015-02-22 23:09:42 +01:00
Tim Graham b2f331dc68 Updated tutorial to use explicit relative imports. 2015-02-22 14:20:02 -05:00
Tim Graham ff5e47e7a4 Corrected sqlmigrate output in tutorial 1. 2015-02-22 12:29:01 -05:00
Tim Graham 7901eccf2e Fixed #24371 -- Cautioned against trying to switch databases. 2015-02-22 10:11:18 -05:00
Aymeric Augustin 88a5f17d25 Fixed #24389 -- Isolated the CSRF view from the TEMPLATES setting.
Thanks uranusjr for the report and analysis.
2015-02-22 15:46:35 +01:00
Sean Wang eba6dff581 Fixed #24358 -- Corrected code-block directives for console sessions. 2015-02-22 09:35:39 -05:00
Michael Angeletti ea3168dc6c Fixed #24376 -- added verbose_name arg to UUIDField 2015-02-21 13:27:49 -05:00
Aymeric Augustin 787dd6519a Removed obsolete reference to media directory. 2015-02-21 17:52:24 +01:00
Aymeric Augustin bd059e3f8c Removed workaround for SVN limitations.
In addition to simplifying the code, this reduces the number of writes.
2015-02-21 17:52:24 +01:00
Aymeric Augustin 2bb5b0e098 Avoided collecting admin static files in tests.
This makes the staticfiles tests 2.5 times faster.
2015-02-21 17:46:26 +01:00
Aymeric Augustin 1d9d39fa1c Removed TestServeAdminMedia.
It should have been removed when the ADMIN_MEDIA_PREFIX setting was deprecated.
2015-02-21 17:46:26 +01:00
Loic Bistuer fa5f936b48 Fixed allow_migrate signature in one of the tests.
Refs #24351.
2015-02-21 23:13:14 +07:00
Don Kirkby 99a1bbf985 Fixed typo in django/db/models/fields/files.py comment. 2015-02-20 20:11:13 -05:00
foresmac 1d1d5d1c31 Fixed #24341 -- Added specific error messages to RangeField subclasses 2015-02-20 16:49:15 -05:00
Simon Charette 19f7278c86 Removed reference to iteration count in the PBKDF2 hasher docstring. 2015-02-20 16:37:29 -05:00
Aymeric Augustin 51b606f75d Removed a non-obvious side-effect of assigning Context.template.
Explicit is better than implicit.
2015-02-20 22:27:48 +01:00
Frank Wiles e43f99d1a9 Fixed PBKDF2PasswordHasher comments to reflect reality. 2015-02-20 16:00:51 -05:00
Anssi Kääriäinen bad5f262bf Fixed #24328 -- cleaned up Options._get_fields() implementation 2015-02-20 13:00:12 -05:00
Loic Bistuer bed504d70b Fixed #24351, #24346 -- Changed the signature of allow_migrate().
The new signature enables better support for routing RunPython and
RunSQL operations, especially w.r.t. reusable and third-party apps.

This commit also takes advantage of the deprecation cycle for the old
signature to remove the backward incompatibility introduced in #22583;
RunPython and RunSQL won't call allow_migrate() when when the router
has the old signature.

Thanks Aymeric Augustin and Tim Graham for helping shape up the patch.

Refs 22583.
2015-02-20 21:34:09 +07:00
Tim Graham dd0b487872 Fixed typo in path to is_safe_url() 2015-02-20 09:21:39 -05:00
Tim Graham d28bcba209 Fixed typo in docs/internals/contributing/triaging-tickets.txt 2015-02-20 07:26:16 -05:00
Marc Tamlyn c490e410af Fixed #24373 -- Added run_validators to ArrayField.
Thanks to DavidMuller for the report.
2015-02-20 11:51:46 +00:00
Marc Tamlyn 32d4db66b9 Update converters to take a consistent set of parameters.
As suggested by Anssi. This has the slightly strange side effect of
passing the expression to Expression.convert_value has the expression
passed back to it, but it allows more complex patterns of expressions.
2015-02-20 11:35:52 +00:00