| Age | Commit message (Collapse) | Author |
|
of fixtures.
Thanks to lgs for the report and initial patch.
|
|
redirect's response.
Thanks mjtamlyn for the suggestion.
|
|
Added DiscoverRunner.test_suite and .test_runner attributes.
Thanks tomchristie for the suggestion and jcd for the patch.
|
|
* override_settings may now be imported from django.test
* removed Approximate from django.test
* updated documentation for things importable from django.test
Thanks akaariai for the suggestion.
|
|
|
|
Fixed
comment_tests.tests.test_comment_view.CommentViewTests.testCommentPostRedirectWithInvalidIntegerPK.
Refs #20530.
|
|
They were defined in base when the mod_python handler used them. See bfcecbff.
|
|
local variables
|
|
|
|
1. Moved common logic between assertContains and assertNotContains
into a separate function _assert_contains()
2. Moved common logic between assertTemplateUsed and
assertTemplateNotUsed into a separate function
_assert_templateused()
Thanks Marc Tamlyn for the report and review.
|
|
Do this by introducing a django.contrib.staticfiles.testing.StaticLiveServerCase
unittest TestCase subclass.
Fixes #20739.
|
|
|
|
Conflicts:
docs/ref/django-admin.txt
|
|
|
|
|
|
dispatch_uid
This prevents the test client context from being lost when the client
is used in a nested fashion.
|
|
Conflicts:
django/core/management/commands/flush.py
django/core/management/commands/syncdb.py
django/db/models/loading.py
docs/internals/deprecation.txt
docs/ref/django-admin.txt
docs/releases/1.7.txt
|
|
|
|
This was a shim for pre-Python 2.7 support.
|
|
Conflicts:
django/db/backends/mysql/introspection.py
django/db/backends/oracle/creation.py
django/db/backends/postgresql_psycopg2/creation.py
django/db/models/base.py
django/db/models/loading.py
|
|
Thanks Tim Graham for the review and improved patch.
|
|
|
|
aliases
Thanks simonpercivall.
|
|
|
|
Thanks Waldemar Kornewald and mvschaik for work on the patch.
|
|
|
|
default db.
Thanks simonpercivall.
|
|
|
|
Silenced warnings caused by the deprecation of django.utils.unittest.
Thanks Preston Timmons and Carl Meyer for their advice.
Fixed #20680.
|
|
Refs #20680.
|
|
|
|
Following the series of commits removing deprecated features in
Django 1.7, here are some more unneeded imports removed and other
minor cleanups.
|
|
|
|
Conflicts:
django/db/backends/__init__.py
django/db/models/fields/related.py
tests/field_deconstruction/tests.py
|
|
In Django < 1.6, override_settings restores the settings module that was
active when the override_settings call was executed, not when it was
run. This can make a difference when override_settings is applied to a
class, since it's executed when the module is imported, not when the
test case is run.
In addition, if the settings module for tests is stored alongside the
tests themselves, importing the settings module can trigger an import
of the tests. Since the settings module isn't fully imported yet,
class-level override_settings statements may store a reference to an
incorrect settings module. Eventually this will result in a crash during
test teardown because the settings module restored by override_settings
won't the one that was active during test setup.
While Django should prevent this situation in the future by failing
loudly in such dubious import sequences, that change won't be backported
to 1.5 and 1.4. However, these versions received the "allowed hosts"
patch and they're prone to "AttributeError: 'Settings' object has no
attribute '_original_allowed_hosts'". To mitigate this regression, this
commits stuffs _original_allowed_hosts on a random module instead of the
settings module.
This problem shouldn't occur in Django 1.6, see #20290, but this patch
will be forward-ported for extra safety.
Also tweaked backup variable names for consistency.
Forward port of 0261922 from stable/1.5.x.
Conflicts:
django/test/utils.py
|
|
Refactored override_settings to store the underlying settings._wrapped
value seen at runtime, not instantiation time.
|
|
|
|
tomchristie/remove-incorrect-content-type-test-client
Remove incorrect CONTENT_TYPE header from GET and HEAD requests
|
|
|
|
Also moved its documentation to the 'advanced' section. It doesn't
belong to the 'overview'. Same for TransactionTestCase.reset_sequences.
When available_apps is set, after a TransactionTestCase, the database
is now totally empty. post_syncdb is fired at the beginning of the next
TransactionTestCase.
Refs #20483.
|
|
This can be used to make Django's test suite significantly faster by
reducing the number of models for which content types and permissions
must be created and tables must be flushed in each non-transactional
test.
It's documented for Django contributors and committers but it's branded
as a private API to preserve our freedom to change it in the future.
Most of the credit goes to Anssi. He got the idea and did the research.
Fixed #20483.
|
|
Thanks awsum for the suggestion and Pavel Ponomarev and
Florian Hahn for the patch.
|
|
It's useful to be able to list all the (flattened) keys of a
ContextList, to help you figure out why the variable that's supposed
to be there is not.
No .values() or .items() added as the definition for those aren't clear.
The patch is Chris Wilson's patch from pull request 1065 with some
modifications by committer.
|
|
test code.
The ``DocTestRunner`` and ``OutputChecker`` were formerly in
``django.test.testcases``, now they are in ``django.test.simple``. This avoids
triggering the ``django.test._doctest`` deprecation message with any import
from ``django.test``. Since these utility classes are undocumented internal
API, they can be moved without a separate deprecation process.
Also removed the deprecation warnings specific to these classes, as they are
now covered by the module-level warning in ``django.test.simple``.
Thanks Anssi for the report.
Refs #17365.
|
|
Thank-you Martin Green for the patch.
|
|
SuspiciousOperations have been differentiated into subclasses, and
are now logged to a 'django.security.*' logger. SuspiciousOperations
that reach django.core.handlers.base.BaseHandler will now return a 400
instead of a 500.
Thanks to tiwoc for the report, and Carl Meyer and Donald Stufft
for review.
|
|
Thanks zalew for the suggestion and work on a patch.
Also updated, tweaked and fixed testing documentation.
|
|
TestCase._fixture_setup disables transactions so,
in case of an error, cleanup is needed to re-enable
transactions, otherwise following TransactionTestCase
would fail.
|
|
This mixin is useful whenever deprecating a large part of Django.
|
|
Thanks to Preston Timmons for the bulk of the work on the patch, especially
updating Django's own test suite to comply with the requirements of the new
runner. Thanks also to Jannis Leidel and Mahdi Yusuf for earlier work on the
patch and the discovery runner.
Refs #11077, #17032, and #18670.
|