Commit Graph

244 Commits

Author SHA1 Message Date
Tim Graham 192b3637c5 Removed unnecessary postgres logic in runtests.py
Obsolete after 36e90d1f45
2015-06-03 12:20:12 -04:00
Tim Graham 8efea1b8d5 Fixed #24526 -- Combined django.request/security loggers with the root logger.
Thanks Carl Meyer for review.
2015-04-24 11:07:42 -04:00
Claude Paroz ea27e26b09 Deprecated legacy GeoManager/GeoQuerySet methods 2015-04-22 19:54:17 +02:00
Claude Paroz 36e90d1f45 Stopped special-casing postgres-specific tests
Refs #23879.
2015-04-18 15:17:49 +02:00
Claude Paroz 6b6d13bf6e Stopped conditional discovery of gis_tests apps
Refs #23879.
2015-04-18 15:17:49 +02: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
Tim Graham 8b39f33d78 Fixed #24290 -- Skipped postgres_tests if not running with PostgreSQL. 2015-02-17 06:34:13 -05:00
Tim Graham 664c038f2c Moved contrib.contenttypes tests out of contrib. 2015-02-16 17:45:38 -05:00
Markus Holtermann b4e1090ab2 Removed explicit pointers to migration modules for contrib apps in runtest
Thanks Tim Graham for the patch
2015-02-13 14:29:45 +01:00
Tim Graham 7cf3a5786b Updated docs and runtests.py for removal of tests from contrib. 2015-02-11 10:29:54 -05:00
Tim Graham ad0be620ae Moved contrib.gis tests out of contrib. 2015-02-11 10:29:54 -05:00
Tim Graham 00da46091a Moved contrib.redirects tests out of contrib. 2015-02-11 10:19:22 -05:00
Tim Graham d3a725054f Moved contrib.flatpages tests out of contrib. 2015-02-11 10:19:22 -05:00
Tim Graham c970018f41 Removed Django 1.7 MIDDLEWARE_CLASSES upgrade check. 2015-02-09 19:16:07 -05:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Aymeric Augustin d39073b8ae Hid Django installation message when verbosity is 0.
This message was introduced to help people figure out quickly when they
aren't running the tests against the copy of Django they're editing.
There's no reason to display it when verbosity is set to 0. It defaults
to 1.
2015-02-06 12:56:53 +01:00
Tim Graham 1fc458b5a3 Removed a useless check in runtests.py
Added in 3e97535907, this check
appears to never be triggered today.
2015-02-03 18:32:00 -05:00
Tim Graham c0cc8f69e7 Refactored tests that rely on an ImportError for Python 3.5 compatibility
A change in Python test discovery [1] causes the old packages that raised
an error to be discovered; now we use a common directory that's
ignored during discovery. Refs #23763.

[1] http://bugs.python.org/issue7559
2015-02-03 18:30:46 -05:00
darkryder 9ec8aa5e5d Fixed #24149 -- Normalized tuple settings to lists. 2015-02-03 14:59:45 -05:00
Tim Graham 378a0d27d6 Advanced deprecation warnings for Django 1.9. 2015-01-19 12:22:41 -05:00
Tim Graham 8d959f73be Removed obsolete deprecation warning in runtests.py 2015-01-17 19:41:46 -05:00
Tim Graham 67235fd4ef Removed support for initial_data fixtures per deprecation timeline. 2015-01-17 09:59:25 -05:00
Aymeric Augustin 5f7230e12f Fixed #24124 (again) -- Updated tests with new default context_processors.
Thanks Collin for the review.
2015-01-12 22:31:44 +01:00
Marc Tamlyn b5c1a85b50 Fixed #24118 -- Added --debug-sql option for tests.
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.
2015-01-12 08:16:08 +00:00
Tim Graham 40a8504357 Fixed #23891 -- Moved deprecation of IPAddressField to system check framework.
Thanks Markus Holtermann for review.
2015-01-01 13:30:52 -05:00
Aymeric Augustin b7282db833 Raised a warning when using the legacy TEMPLATE_* settings.
All tests now rely on TEMPLATES.
2014-12-28 17:02:31 +01:00
Tim Graham 82e4f956e3 Fixed #23289 -- Added mock as a test dependency. 2014-12-01 16:08:25 -05:00
Tim Graham 3131e9cef5 Fixed #23923 -- Promoted Django's deprecation warnings to errors in runtests.py 2014-11-29 10:27:04 -05:00
wrwrwr e22c64dfc0 Fixed #23742 -- Added an option to reverse tests order.
This is useful for debugging side effects affecting tests that
are usually executed before a given test. Full suite and pair
tests sort cases more or less deterministically, thus some test
cross-dependencies are easier to reveal by reversing the order.

Thanks Preston Timmons for the review.
2014-11-24 19:24:11 -05:00
Simon Charette 8330b50c85 Fixed #23863 -- Made runtests accept the keepdb option.
refs #20550
2014-11-21 11:41:13 -05:00
Marc Tamlyn 36f514f065 Added HStoreField.
Thanks to `django-hstore` for inspiration in some areas, and many people
for reviews.
2014-11-04 09:26:40 +00:00
Claude Paroz 6295ea0027 Replaced HAS_SPATIAL_DB by testing database feature
Refs #22632. This should be the base for using more database
features to exclude specific backends in GIS tests.
Thanks Tim Graham for the review.
2014-08-19 17:57:01 +02:00
Tim Graham f53b1c779b Fixed #23099 -- Removed usage of deprecated initial data in Django's test suite.
Thanks Claude Paroz for assistance with debugging the tests.
2014-08-08 14:01:59 -04:00
Tim Graham 99cd80dc74 Silenced test warning for deprecated IPAddressField. 2014-07-24 11:27:26 -04:00
Tim Graham 38e001ab6c Fixed #22789 -- Deprecated django.contrib.webdesign.
Moved the {% lorem %} tag to built-in tags.
2014-07-14 08:45:19 -04:00
Claude Paroz c6a711d9e5 Removed some apps from ALWAYS_INSTALLED_APPS 2014-06-21 21:01:37 +02:00
Tim Graham b341f33697 Added database migration for contrib.auth.
refs #22170.
2014-06-16 16:21:37 -04:00
Tim Graham eb8600a656 Added database migration for contrib.contenttypes.
Moved contenttypes tests to allow them to run correctly in the presence of
migrations. refs #22170.
2014-06-16 15:03:00 -04:00
mlavin 4696cd9671 Fixed #22477 -- Removed contrib middleware from the global settings defaults.
Also added a compatibility check for changed middleware defaults.

Forwardport of d94de802d3 from stable/1.7.x
2014-06-13 12:45:56 -04:00
Preston Timmons 68efbfde5e Fixed #22068 -- Made runtests.py remove trailing slashes from test labels.
When using tab-completion it's easy to accidentally run a test with
a trailing slash, which causes INSTALLED_APPS to be set incorrectly.
Normalize the test labels to avoid this common error.

Thanks MattBlack for the suggestion.
2014-06-11 11:35:33 -04:00
Claude Paroz 96e4b52ab2 Converted Django scripts to argparse
Refs #19973.
2014-06-09 10:13:37 +02:00
Loic Bistuer 417ec4a68b Fixed a ResourceWarning that wasn't properly fixed by the previous commit.
Also removed unused import in runtests.py.
2014-05-26 04:01:41 +07:00
Claude Paroz f47e226ff7 Moved some imports in runtests.py 2014-05-24 13:29:23 +02:00
Claude Paroz 19b4908206 Made runtests.py use 'set_installed_apps' API
This will also trigger the ready method of any tested application,
which was not run before.
2014-05-24 11:02:58 +02:00
Marc Tamlyn 604162604b Added array field support for PostgreSQL.
The first part of django.contrib.postgres, including model and two form
fields for arrays of other data types.

This commit is formed of the following work:

    Add shell of postgres app and test handling.

    First draft of array fields.

    Use recursive deconstruction.

    Stop creating classes at lookup time.

    Add validation and size parameter.

    Add contained_by lookup.

    Add SimpleArrayField for forms.

    Add SplitArrayField (mainly for admin).

    Fix prepare_value for SimpleArrayField.

    Stop using MultiValueField and MultiWidget.

    They don't play nice with flexible sizes.

    Add basics of admin integration.

    Missing:
    - Tests
    - Fully working js

    Add reference document for django.contrib.postgres.fields.ArrayField.

    Various performance and style tweaks.

    Fix internal docs link, formalise code snippets.

    Remove the admin code for now.

    It needs a better way of handing JS widgets in the admin as a whole
    before it is easy to write. In particular there are serious issues
    involving DateTimePicker when used in an array.

    Add a test for nested array fields with different delimiters.

    This will be a documented pattern so having a test for it is useful.

    Add docs for SimpleArrayField.

    Add docs for SplitArrayField.

    Remove admin related code for now.

    definition -> description

    Fix typo.

    Py3 errors.

    Avoid using regexes where they're not needed.

    Allow passing tuples by the programmer.

    Add some more tests for multidimensional arrays.

    Also fix slicing as much as it can be fixed.

    Simplify SplitArrayWidget's data loading.

    If we aren't including the variable size one, we don't need to search
    like this.
2014-05-22 09:53:26 +01:00
Preston Timmons 251e833c75 Removed old test runner test cases.
These files were added as part of #12658, which pertained to the old django.test.simple test runner. No tests call them anymore.
2014-04-20 22:00:39 -05:00
Aymeric Augustin 232181d1c5 Advanced deprecation warnings for 1.8. 2014-03-22 21:12:58 +01:00
Tim Graham aa93a1890f Removed contrib.comments per deprecation timeline. 2014-03-21 07:05:36 -04:00
Claude Paroz 210d0489c5 Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warnings
Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
2014-03-08 09:57:40 +01:00
Claude Paroz 4622d23ccf Fixed #22056 -- Omitted non-package directories when collecting tests
This allows us to ignore empty dirs or other unrelated dirs.
Thanks Sebastian Pawluś for the report and the initial patch.
2014-02-26 17:46:24 +01:00
Aymeric Augustin 4a488c1483 Silenced a spurious warning.
Thanks Timo for the report. Regression from 2f65b8e1. Refs #21794.
2014-02-01 19:42:41 +01:00
Aymeric Augustin 2ff93e027c Fixed #21829 -- Added default AppConfigs.
Thanks Russell for the report, Marc for the initial patch, Carl for the
final review, and everyone who contributed to the design discussion.
2014-01-25 10:41:56 +01:00
Aymeric Augustin 74d8fdcfa6 Stopped assuming that INSTALLED_APPS only contains app names.
While this assumption is true for the time being, it makes the code
needlessly brittle.
2014-01-18 23:06:00 +01:00
Aymeric Augustin 3326a412cc Deprecated importing a model before loading its application.
Refs #21719, #21680.
2014-01-10 23:43:10 +01:00
Claude Paroz b2d78939d1 Prevented calling setup() inside catch_warnings
When django.setup() (and then configure_logging) is called inside
catch_warnings, logging setup is negatively affected (notably
warnings.showwarning definition).
2014-01-01 22:59:12 +01:00
Aymeric Augustin 80d74097b4 Stopped populating the app registry as a side effect.
Since it triggers imports, it shouldn't be done lightly.

This commit adds a public API for doing it explicitly, django.setup(),
and does it automatically when using manage.py and wsgi.py.
2013-12-30 22:11:17 +01:00
Aymeric Augustin 38ce41103f Used Apps.clear_cache() in tests that alter the app registry. 2013-12-29 21:25:28 +01:00
Aymeric Augustin 8f04f53dd8 Removed a few gratuitous lambdas. 2013-12-26 14:03:50 +01:00
Aymeric Augustin 1716b7ce5a Renamed AppCache to Apps.
Also renamed app_cache to apps and "app cache" to "app registry".

Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-24 12:25:17 +01:00
Aymeric Augustin 82a35e24d4 Replaced ad-hoc caching of get_models with lru_cache.
Invalidate properly the cache whenever all_models or app_configs change.
This fixes some isolation issues in the test suite.
2013-12-24 10:56:50 +01:00
Aymeric Augustin da16bb30ff Dropped AppCache._empty, _with_app and _without_app.
It's now easier to achieve the same effect with modify_settings or
override_settings.
2013-12-23 21:37:56 +01:00
Aymeric Augustin 2fef9e5375 Moved apps back in the toplevel django namespace.
Reverted 4a56a93cc4.
2013-12-22 11:39:55 +01:00
Aymeric Augustin f25fa9d859 Deprecated load_app().
Adjusted several tests that used it to add apps to the app cache and
then attempted to remove them by manipulating attributes directly.

Also renamed invalid_models to invalid_models_tests to avoid clashing
application labels between the outer and the inner invalid_models
applications.
2013-12-22 11:39:17 +01:00
Aymeric Augustin 86804ab063 Terminated AppCache._populate() with extreme prejudice.
It was called _populate() before I renamed it to populate(). Since it
has been superseded by populate_models() there's no reason to keep it.

Removed the can_postpone argument of load_app() as it was only used by
populate(). It's a private API and there's no replacement. Simplified
load_app() accordingly. Then new version behaves exactly like the old
one even though it's much shorter.
2013-12-22 11:39:17 +01:00
Aymeric Augustin 6e895f9e06 Removed superfluous models.py files.
Added comments in the three empty models.py files that are still needed.

Adjusted the test runner to add applications corresponding to test
labels to INSTALLED_APPS even when they don't have a models module.
2013-12-17 11:16:48 +01:00
Aymeric Augustin 4a56a93cc4 Moved the new app cache inside core. 2013-12-17 10:17:46 +01:00
Aymeric Augustin 2732edc5f2 Deprecated get_apps(). 2013-12-17 10:17:45 +01:00
Aymeric Augustin d44de9b933 Removed the _-prefix for populate().
Several parts of Django call get_apps() with a comment along this lines
of "this has the side effect of calling _populate()". I fail to see how
this is better than just calling populate()!
2013-12-17 10:17:45 +01:00
Aymeric Augustin 8662654d6d Removed module-level functions for the app cache.
Since the original ones in django.db.models.loading were kept only for
backwards compatibility, there's no need to recreate them. However, many
internals of Django still relied on them.

They were also imported in django.db.models. They never appear in the
documentation, except a quick mention of get_models and get_app in the
1.2 release notes to document an edge case in GIS. I don't think that
makes them a public API.

This commit doesn't change the overall amount of global state but
clarifies that it's tied to the app_cache object instead of hiding it
behind half a dozen functions.
2013-12-17 10:17:44 +01:00
Aymeric Augustin 860c2c8bc5 Moved django.db.models.loading to django.apps.cache.
This commit doesn't contain any code changes; it's purely a refactoring.
2013-12-17 10:17:43 +01:00
Christopher Medrela 7477a4ffde Fixed E125 pep8 warnings 2013-11-28 08:50:11 -05:00
Tim Graham c573d6de17 Fixed #19941 -- Removed sys.path hack when running the test suite.
Thanks jezdez for the suggestion.
2013-10-23 18:27:06 -04:00
Alasdair Nicol a800036981 Fixed #21287 -- Fixed E123 pep8 warnings 2013-10-18 10:07:39 +01:00
Kevin Christopher Henry 978e1351a6 Fixed #21122 -- Improved clean up of test temp directory on Windows
- Fixed test that didn't close the files it opened
- Caught and handled exception when temp directory cannot be removed
2013-10-02 09:12:58 -04:00
Simon Charette ab643cd634 Fixed test suite bisection on Python 3.
Thanks to @marfire for spotting this.
2013-09-23 17:05:36 -04:00
Tim Graham 86964a7b4f Silenced deprecation warning regarding old SQL location; refs #14300 2013-09-03 11:10:43 -04:00
Ramiro Morales 72712755c4 Ignore coverage HTML report output dir in tests.
Added it to the list of dirs ignored by tests/runtests.py.
2013-08-25 19:09:03 -03:00
Ramiro Morales deebb1a977 Import test case classes from their public API module. 2013-08-20 22:23:41 -03:00
Ramiro Morales 22af1394c6 Expand testing of Test LiveServerTestCase static files serving. 2013-08-10 16:32:07 -03:00
Anssi Kääriäinen b2314d9e1e Fixed #19941 -- Modified runtests.py to make running the tests easier.
1. Automatically use tests/../django as the Django version.
2. If settings aren't provided through --settings or DJANGO_SETTINGS_MODULE)
   then use test_sqlite.
2013-07-24 07:33:03 -04:00
Tim Graham 4d92a0bd86 Fixed #19196 -- Added test/requirements 2013-07-10 09:24:05 -04:00
Claude Paroz 57f190ed3b Only import gis test apps for geo-enabled DBs 2013-07-09 15:58:56 +02:00
Claude Paroz bd563f0f57 Trusted test skipping about gis tests running or not
With the new test discovery system, gis tests are discovered as
other tests. They should be properly skipped now when dependencies
are missing. So let's stop special casing their inclusion.
2013-07-09 15:17:26 +02:00
Aymeric Augustin acd7b34aaf Advanced deprecation warnings for Django 1.7. 2013-06-29 18:49:37 +02:00
Marc Tamlyn 46789e76c6 Fixed #20548 -- Removed all PendingDeprecationWarnings from django test suite 2013-06-14 15:37:39 +01:00
Florian Apolloner af70dfcf31 Reverted the introduction of shared_models.
The recent improvements should make shared_models obsolete.

This reverts commit 1059da8de6, reversing
changes made to 4fa7f3cdd9.
2013-06-10 12:34:47 +02:00
Aymeric Augustin c6e6d4eeb7 Defined available_apps in relevant tests.
Fixed #20483.
2013-06-10 11:30:01 +02:00
Florian Apolloner e23a5f9a47 Fixed a regression in the test runner loading of runtests.py.
Refs #17365, #17366, #18727.
2013-05-11 15:47:40 +02:00
Carl Meyer 9012833af8 Fixed #17365, #17366, #18727 -- Switched to discovery test runner.
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.
2013-05-10 23:08:45 -04:00
Preston Holmes e79b857a07 Fixed #18985 -- ensure module level deprecations are displayed
Also don't compete with -W CLI option.

Thanks to Aymeric Augustin for the catch, and Claude Paroz for the patch.
2013-03-24 22:06:02 -07:00
Jacob Kaplan-Moss 1059da8de6 Merge pull request #900 from bmispelon/ticket-20022
Fix #20022: Correctly handle prefixes with url-unsafe characters in reverse()
2013-03-13 22:39:25 +01:00
Jacob Kaplan-Moss d056124269 Remove a special case for comment tests from runtests.py. 2013-03-11 15:38:53 -05:00
Claude Paroz 9b74a8391d Removed forced settings in runtests
Tests that require USE_I18N, LOGIN_URL or certain MIDDLEWARE_CLASSES
should be decorated appropriately.
2013-03-11 17:46:56 +01:00
Florian Apolloner 0dc7ff6b7a Ensured that we have an absolute path to RUNTESTS_DIR.
This is needed to make 'python runtests.py' work, otherwise only
'python ./runtests.py' would work.
2013-02-26 15:20:37 +01:00
Florian Apolloner 33836cf88d Renamed some tests and removed references to modeltests/regressiontests. 2013-02-26 14:36:57 +01:00
Florian Apolloner fc074db29c Adjusted runtests to the new layout. 2013-02-26 14:36:57 +01:00
Florian Apolloner 41d7a9a907 Moved test_templates to templates to prevent issues with regressiontests/templates later on. 2013-02-26 14:36:57 +01:00
Carl Meyer 906dc8522a Fixed #19854 -- Turn Django's own Selenium tests off by default. 2013-02-25 10:14:42 -07:00
Florian Apolloner e4ee3d8fca Fixed a few ResourceWarnings. 2013-02-24 13:11:19 +01:00
Zbigniew Siciarz 1cd2f51eb4 Added test runner option to skip Selenium tests (#19854). 2013-02-23 17:45:26 +01:00