| Age | Commit message (Collapse) | Author |
|
textwrap.indent() is new in Python 3.3.
|
|
This reduces the time spent cloning databases.
Thanks Tim for the suggestion.
|
|
Subclass private APIs is marginally better than monkey-patching them,
even if it doesn't make a big difference in practice.
|
|
|
|
Notably it will fail to report a Model.DoesNotExist exceptions because
the class itself isn't pickleable. (Django has specific code to make its
instances pickleable.)
|
|
|
|
This is required for running tests in parallel.
|
|
|
|
|
|
|
|
Use the same code path for:
- a database that has the same settings as another database
(as defined by test_db_signature)
- a database this is defined as a mirror of another database
There's no conceptual difference between these two cases.
Thanks Shai for the suggestion.
|
|
The return value of setup_databases is only used as an argument for
teardown_databases which doesn't need mirrors.
|
|
In order to reuse another database, Django must use set_as_test_mirror.
|
|
It contained two sections separated by comments. It makes more sense to
put each section in its own function.
|
|
|
|
|
|
Moved the lookup in Field.swappable_setting to Apps, and added
an lru_cache to cache the results.
Refs #24743
Thanks Marten Kenbeek for the initial work on the patch. Thanks Aymeric
Augustin and Tim Graham for the review.
|
|
serialized_rollback.
When using a TransactionTestCase with serialized_rollback=True,
after creating the database and running its migrations (along with
emitting the post_migrate signal), the contents of the database
are serialized to _test_serialized_contents.
After the first test case, _fixture_teardown() would flush the
tables but then the post_migrate signal would be emitted and new
rows (with new PKs) would be created in the django_content_type
table. Then in any subsequent test cases in a suite,
_fixture_setup() attempts to deserialize the content of
_test_serialized_contents, but these rows are identical to the
rows already in the database except for their PKs. This causes an
IntegrityError due to the unique constraint in the
django_content_type table.
This change made it so that in the above scenario the post_migrate
signal is not emitted after flushing the tables, since it will be
repopulated during fixture_setup().
|
|
|
|
|
|
transaction.
|
|
Thanks Chris Jerdonek for the suggestion and help with the patch.
|
|
Thanks Aymeric Augustin for review.
|
|
|
|
|
|
Forwardport of ae1d663b7913f6da233c55409c4973248372d302
from stable/1.8.x plus more.
|
|
|
|
|
|
No tests are provided because there is no sane way to test database
settings within the Django test suite.
Thanks Aymeric Augustin for review.
|
|
|
|
* Converted the ``libraries`` and ``builtins`` globals of
``django.template.base`` into properties of the Engine class.
* Added a public API for explicit registration of libraries and builtins.
|
|
Thanks to Tim and Anssi for the review.
|
|
This was broken in c2bc1cefdcbbf074408f4a4cace88b315cf9d652 (refs #23763).
|
|
The primary use case is to interact with a third-party database (not
primarily managed by Django) that doesn't support time zones and where
datetimes are stored in local time when USE_TZ is True.
Configuring a PostgreSQL database with the TIME_ZONE option while USE_TZ
is False used to result in silent data corruption. Now this is an error.
|
|
warning on Python 3.5.
Deprecation warning was introduced in https://bugs.python.org/issue24134
|
|
|
|
Thanks Carl Meyer for review.
|
|
|
|
Thanks Carl Meyer for the report and Tim Graham for the review.
|
|
Tests were using an undocumented keyword argument for easily overriding
script prefix while reversing. This is now changed into a test utility
which can be used as decorator or context manager.
|
|
Follow-up of f4f24d30e0.
|
|
|
|
|
|
|
|
|
|
during tests
Cleared caching in staticfiles_storage and get_finder when
relevant settings are changed.
|
|
Specifically in rendering shortcuts, template responses, and class-based
views that return template responses.
Also added a test for render_to_response(status=...) which was missing
from fdbfc980.
Thanks Tim and Carl for the review.
|
|
|
|
Added a --debug-sql option for tests and runtests.py which outputs the
SQL logger for failing tests. When combined with --verbosity=2, it also
outputs the SQL for passing tests.
Thanks to Berker, Tim, Markus, Shai, Josh and Anssi for review and
discussion.
|
|
Refs #21281. Thanks Tim Graham and Thomas Chaumeny for investigations.
|