summaryrefslogtreecommitdiff
path: root/django/test
AgeCommit message (Collapse)Author
2013-09-11Fixed #21089 -- Allow TransactionTestcase subclasses to define an empty list ↵Baptiste Mispelon
of fixtures. Thanks to lgs for the report and initial patch.
2013-09-10Fixed #20919 -- Extended assertRedirects to be able to avoid fetching ↵Juan Catalano
redirect's response. Thanks mjtamlyn for the suggestion.
2013-09-10Fixed #16534 -- Improved ability to customize DiscoverRunnerTim Graham
Added DiscoverRunner.test_suite and .test_runner attributes. Thanks tomchristie for the suggestion and jcd for the patch.
2013-09-09Fixed #19885 -- cleaned up the django.test namespaceKevin Christopher Henry
* 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.
2013-09-07Oops :(Aymeric Augustin
2013-09-07Fixed an encoding issue in the test client.Aymeric Augustin
Fixed comment_tests.tests.test_comment_view.CommentViewTests.testCommentPostRedirectWithInvalidIntegerPK. Refs #20530.
2013-09-07Moved two WSGI-specific functions to the WSGI handler.Aymeric Augustin
They were defined in base when the mod_python handler used them. See bfcecbff.
2013-09-06Fixed a number of flake8 errors -- particularly around unused imports and ↵Alex Gaynor
local variables
2013-09-05Took advantage of django.utils.six.moves.urllib.*.Aymeric Augustin
2013-09-05Fixed #20918 -- Tidied up implementation of custom assertionsersran9
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.
2013-08-31Made django.test.testcases not depend on staticfiles contrib app.Ramiro Morales
Do this by introducing a django.contrib.staticfiles.testing.StaticLiveServerCase unittest TestCase subclass. Fixes #20739.
2013-08-30Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette
2013-08-19Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
Conflicts: docs/ref/django-admin.txt
2013-08-13Fixed #20864 -- Made the test client use common method for performing requests.Krzysztof Jurewicz
2013-08-10Docs tweaks (thanks timgraham)Andrew Godwin
2013-08-09Fixed #18356 -- Gave the test client signals.template_rendered call a unique ↵Bojan Mihelac
dispatch_uid This prevents the test client context from being lost when the client is used in a nested fashion.
2013-08-09Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
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
2013-07-30Rename pre_ and post_syncdb to *_migrate, with aliases from old namesAndrew Godwin
2013-07-29Deprecated django.utils.importlibClaude Paroz
This was a shim for pre-Python 2.7 support.
2013-07-22Merge branch 'master' into schema-alterationAndrew Godwin
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
2013-07-19Fixed #18551 -- Enabled skipIfDBFeature/skipUnlessDBFeature to decorate a classClaude Paroz
Thanks Tim Graham for the review and improved patch.
2013-07-14Fixed #20746 -- Removed Python 2.6 specific code/docsTim Graham
2013-07-13Fixed #20681 -- Prevented teardown_databases from attempting to tear down ↵Tim Graham
aliases Thanks simonpercivall.
2013-07-12Fixed #19031 -- Added a warning when using override_settings with 'DATABASES'Joeri Bekker
2013-07-11Fixed #13721 -- Added UploadedFile.content_type_extra.Benjamin Kagia
Thanks Waldemar Kornewald and mvschaik for work on the patch.
2013-07-09Simplified testing connection typeClaude Paroz
2013-07-04Fixed #19940 -- Made test.runner.setup_databases properly handle aliases for ↵Tim Graham
default db. Thanks simonpercivall.
2013-07-02Merge branch 'master' into schema-alterationAndrew Godwin
2013-07-01Removed tests for django.utils.unittest vs. unittest.Aymeric Augustin
Silenced warnings caused by the deprecation of django.utils.unittest. Thanks Preston Timmons and Carl Meyer for their advice. Fixed #20680.
2013-07-01Stopped using django.utils.unittest in the test suite.Aymeric Augustin
Refs #20680.
2013-06-29Advanced deprecation warnings for Django 1.7.Aymeric Augustin
2013-06-29More import removalsClaude Paroz
Following the series of commits removing deprecated features in Django 1.7, here are some more unneeded imports removed and other minor cleanups.
2013-06-28Removed warnings level handling code as per deprecation TL.Ramiro Morales
2013-06-28Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
Conflicts: django/db/backends/__init__.py django/db/models/fields/related.py tests/field_deconstruction/tests.py
2013-06-24Fixed #20636 -- Stopped stuffing values in the settings.Aymeric Augustin
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
2013-06-21Fixed #20290 -- Allow override_settings to be nestedOliver Beattie
Refactored override_settings to store the underlying settings._wrapped value seen at runtime, not instantiation time.
2013-06-19Fix test running with new apps stuff/migrate actually running migrationsAndrew Godwin
2013-06-14Merge pull request #1270 from ↵Marc Tamlyn
tomchristie/remove-incorrect-content-type-test-client Remove incorrect CONTENT_TYPE header from GET and HEAD requests
2013-06-14Remove incorrect CONTENT_TYPE header from GET and HEAD requestsTom Christie
2013-06-12Fixed #20579 -- Improved TransactionTestCase.available_apps.Aymeric Augustin
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.
2013-06-10Added TransactionTestCase.available_apps.Aymeric Augustin
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.
2013-06-04Fixed #18924 -- Made test.Client.logout send user_logged_out signal.Tim Graham
Thanks awsum for the suggestion and Pavel Ponomarev and Florian Hahn for the patch.
2013-06-01Fixed #20404 -- Added a keys() method to ContextList.Chris Wilson
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.
2013-05-27Fixed #20503 - Moved doctest utilities in with the rest of the deprecated ↵Carl Meyer
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.
2013-05-27Fixed #11603 - Added django.test.SimpleTestCase.assertFormsetErrorTim Graham
Thank-you Martin Green for the patch.
2013-05-25Fixed #19866 -- Added security logger and return 400 for SuspiciousOperation.Preston Holmes
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.
2013-05-18Fixed #20004 -- Moved non DB-related assertions to SimpleTestCase.Ramiro Morales
Thanks zalew for the suggestion and work on a patch. Also updated, tweaked and fixed testing documentation.
2013-05-18Fixed #20142 -- Added error handling for fixture setupFilipa Andrade
TestCase._fixture_setup disables transactions so, in case of an error, cleanup is needed to re-enable transactions, otherwise following TransactionTestCase would fail.
2013-05-18Moved IgnorePendingDeprecationWarningsMixin in django.test.utils.Aymeric Augustin
This mixin is useful whenever deprecating a large part of Django.
2013-05-10Fixed #17365, #17366, #18727 -- Switched to discovery test runner.Carl Meyer
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.