| Age | Commit message (Collapse) | Author |
|
This was overlooked in 81f5d63218851f90bd83c1263d9a427db84d6082.
Backport of ab33269b00858de7c37196a1ea044ce2080fd852 from master.
|
|
This reverts commit 49eee84245b1297a84ad4ddc2251e287ef585ea2 as it caused
a regression with test mirrors.
Backport of ce737ac67845da9a73ad645d6b9fb1692390ad56 from master
|
|
Backport of 3ee18400ae9b916da1a3bee9c9c630fd223a2d3c from master
|
|
urlparse() fails with an AttributeError ("'__proxy__' object has no
attribute 'decode'") if reverse_lazy is used to look up the URL
(this is exactly the same problem that caused ticket #18776). The
solution is to use force_str() on the path before handing it to
urlparse().
|
|
Since --parallel is documented not to work on Windows, it's better to
ignore it and run without parallelization than to crash. For example
this could simplify cross-platform test scripts.
|
|
|
|
|
|
Sigh.
|
|
This was the original intent.
|
|
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.
|