Commit Graph

5051 Commits

Author SHA1 Message Date
Andrew Godwin 86e69bf3b6 Fixed #21785: Bad handling of both auto_now and _add on deconstruct 2014-01-17 10:46:03 +00:00
Marc Tamlyn 2607fa9016 Fixed #21774 -- Isolate all test urls from eachother.
This (nearly) completes the work to isolate all the test modules from
each other. This is now more important as importing models from another
module will case PendingDeprecationWarnings if those modules are not in
INSTALLED_APPS. The only remaining obvious dependencies are:

- d.c.auth depends on d.c.admin (because of the is_admin flag to some
  views), but this is not so important and d.c.admin is in
  always_installed_apps
- test_client_regress depends on test_client. Eventually these should
  become a single module, as the split serves no useful purpose.
2014-01-14 15:43:27 +00:00
Marc Tamlyn 22198e6ce5 Be more careful about closing connections in mail tests. 2014-01-12 23:39:44 +00:00
Marc Tamlyn 9d2c5b0420 Undelete the `return True` removed in 4e0a2fe.
This is quite important otherwise we don't close our connections to the
SMTP server.
2014-01-12 23:38:28 +00:00
Aymeric Augustin d562527a16 Fixed #21477 -- Renamed db to using in pre/post_migrate signals. 2014-01-12 22:24:33 +01:00
Aymeric Augustin 225a6ed2cf Fixed a test that was failing with PostGIS.
Fixed #21452 again.

Forward-port of 18d75e07 from stable/1.6.x.
2014-01-12 21:40:22 +01:00
Aymeric Augustin 720c6d3a44 Restored a test broken by overzealous PEP8 cleanup 2014-01-12 21:13:32 +01:00
Simon Charette c726598c3d Fixed flake8 issues. 2014-01-12 13:40:37 -05:00
Florian Apolloner 56ab5f52c7 Merge pull request #2163 from apollo13/signals
Signals
2014-01-12 09:43:41 -08:00
Aymeric Augustin 1afe748832 Fixed #21452 -- Non-autocommit connections to PostgreSQL.
When settings.DATABASES['default']['AUTOCOMMIT'] = False, the connection
wasn't in autocommit mode but Django pretended it was.

Thanks Anssi for analysing this issue.

Refs #17062.
2014-01-12 18:28:51 +01:00
Aymeric Augustin 1c24096f1e Fixed a test isolation issue. Refs #17062.
This test could change settings.DATABASES['default']['TIME_ZONE'] and
didn't restore the previous value.
2014-01-12 18:28:51 +01:00
Anssi Kääriäinen 9918c11114 Fixed #21413 -- resolve_columns fields misalignment 2014-01-12 18:07:39 +02:00
Aymeric Augustin 9cc3371a0f Fixed #21756 -- Skipped two timezone-related tests on Windows.
Windows cannot use a time zone other than the default time zone.

Thanks manfre for the report.
2014-01-12 09:41:57 +01:00
Claude Paroz 0179852d7f Fixed #8898 -- Obsoleted SplitDateTimeWidget usage with DateTimeField
Thanks Tim Graham for the review.
2014-01-11 15:50:34 +01:00
Claude Paroz 18374c1d8c Fixed #21752 -- Prevented custom widget step attribute to be overwritten
Thanks orcein at gmail.com for the report.
2014-01-11 14:08:04 +01:00
Aymeric Augustin 3326a412cc Deprecated importing a model before loading its application.
Refs #21719, #21680.
2014-01-10 23:43:10 +01:00
Unai Zalakain 9eb16031ca Fixed #12571 -- Attached originating WSGIRequest to test client responses.
Originating WSGIRequests are now attached to the ``wsgi_request`` attribute of
the ``HttpResponse`` returned by the testing client.

Thanks rvdrijst for the suggestion.
2014-01-09 18:50:03 -05:00
Florian Apolloner 52cad43bc3 Fixed removal of signal receivers in Python 3.4
Make use of `weakref.finalize` and `weakref.WeakMethod` on python 3.4.
Simplified the removal of receivers, the old function looked overly
complicated.

Many thanks go to Antoine Pitrou for helping me to debug and explain all
the failures I ran into while writing that patch.
2014-01-09 09:27:54 +01:00
Andrew Godwin 9ae17d994b Make test stronger to hopefully fix odd Jenkins failure 2014-01-08 21:20:29 +00:00
Anssi Kääriäinen fa250c2cf9 Merge pull request #2151 from manfre/ticket-21746
Fixed #21746 - Fixed test_get_reverse_on_unsaved_object test.
2014-01-08 08:08:02 -08:00
Michael Manfre 1dbbdb29a0 Fixed #21746 - Fixed test_get_reverse_on_unsaved_object test.
Test will no longer attempt to insert multiple NULL rows in to a unique
field if the database doesn't support it.
2014-01-08 10:52:13 -05:00
Michael Manfre 8845ab62f5 Fixed #21745 - Feature check UniqueTest.test_unique_null 2014-01-08 09:53:40 -05:00
Andrew Godwin 64887c644a Fixed #21142: Dependency failures on unmigrated apps. 2014-01-08 13:00:12 +00:00
Aymeric Augustin 6a320cc14a Fixed #21718 -- Renamed has_app to is_installed. 2014-01-06 22:48:41 +01:00
Aymeric Augustin f5f7617167 Renamed a couple models to prevent duplicate names. 2014-01-05 20:52:46 +01:00
Aymeric Augustin 5d9da7597e Fixed app registry cleanup in app-loading tests. 2014-01-05 20:52:46 +01:00
Aymeric Augustin d4b059d3eb Fixed test for models in non-installed apps.
Models are now attached to any application they're defined in. Since
not_installed was inside app_loading, these models were mistakenly
attached to app_loading. The test that used them passed accidentally
when run after EggLoadingTest because that class' tearDown() method
replaces apps.all_models['app_loading'] by a copy of itself, while
it should remain the same as apps.app_configs['app_loading'].models.
2014-01-05 20:52:46 +01:00
Aymeric Augustin a7588e2e22 Removed useless model definitions.
Surprisingly, this commit doesn't change any behavior at all. When a
model is defined with the same name as another model in the same app,
the definition of the first class is bound to the name of the class
regardless of the definition of the second class.
2014-01-05 20:52:46 +01:00
Claude Paroz 196f0a356d Suppressed ResourceWarning in files tests 2014-01-03 13:37:14 +01:00
Florian Apolloner 3bc6b18cb9 Fixed selenium failure.
This fixes (at least according to tests on the ci itself)
admin_widgets.tests.RelatedFieldWidgetSeleniumFirefoxTests.test_foreign_key_using_to_field

(http://ci.djangoproject.com/job/Django/database=mysql_gis,python=python2.7/3792/testReport/junit/admin_widgets.tests/RelatedFieldWidgetSeleniumFirefoxTests/test_foreign_key_using_to_field/)

The cause for this issue seems to be that wait_page_loaded was executed before click fired
and as such no profile got saved (again just an educated guess, but with this fix I can no
longer reproduce it -- fingers crossed).
2014-01-03 11:29:37 +01:00
Florian Apolloner 7d0a519032 Revert "Fixed #21227 -- Added workaround for selenium test failures"
This reverts commit 08c9ab5a0f.
2014-01-03 00:44:49 +01:00
Florian Apolloner ed2828f0a0 Fixed a few flaky selenium tests.
Many thanks go to David Burns (@AutomatedTester) for helping me understand
css selectors and pointing me towards the correct selenium methods.
2014-01-03 00:36:50 +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 0ce945a671 Fixed #21018 -- Reversed precedence order for management commands. 2014-01-01 18:11:15 +01:00
Preston Timmons 2139e09d83 Removed unused function in test_runner tests
This was used for python 2.6 and unittest2 compatibility. It was
forgotten when the code that used it was removed.
2014-01-01 12:41:43 +01:00
Preston Timmons 18d962f2e6 Fixed #21206 -- Fixed test discovery without labels
Added test to verify an empty label performs discovery on the current
working directory.
2014-01-01 12:40:16 +01:00
Loic Bistuer 4befb3015c Fixed #21581 -- Fixed a number of issues with collectstatic.
When STATIC_ROOT wasn't set, collectstatic --clear would delete
every files within the current directory and its descendants.

This patch makes the following changes:

Prevent collectstatic from running if STATIC_ROOT isn't set.

Fixed an issue that prevented collectstatic from displaying the
destination directory.

Changed the warning header to notify when the command is run
in dry-run mode.
2013-12-31 14:58:49 -05:00
Claude Paroz b8e3373f45 Fixed #21714 -- Moved logging configuration to global setup()
Thanks Aymeric Augustin for the report and the review.
2013-12-31 18:35:00 +01:00
Aymeric Augustin 63137a8304 Enforced unicity of app labels.
Fixed #21679.
2013-12-31 18:04:54 +01:00
Aymeric Augustin c40209dcc0 Made it possible to change an application's label in its configuration.
Fixed #21683.
2013-12-31 17:30:58 +01:00
Aymeric Augustin 553500133c Removed an obsolete unicity check.
It doesn't account for app configs.

Refs #21679.
2013-12-31 17:29:04 +01:00
Claude Paroz 587b678d41 Made DeprecationDisplayTest more robust 2013-12-31 13:12:53 +01:00
Claude Paroz 1fb873cd6b Finished renaming syndication to syndication_tests 2013-12-31 11:56:41 +01:00
Claude Paroz 0b825adcf2 Renamed syndication tests
To resolve the conflict between application names.
2013-12-31 11:25:02 +01:00
Aymeric Augustin bfcc686d22 Removed the only_with_models_module argument of get_model[s].
Now that the refactorings are complete, it isn't particularly useful any
more, nor very well named. Let's keep the API as simple as possible.

Fixed #21689.
2013-12-30 23:59:34 +01:00
Florian Apolloner df075c7489 Merge pull request #2126 from apollo13/email_bytes
Many thanks to @bitdancer and @aaugustin for answering my stupid questions about (mail)encodings and pointing me in the right direction.
2013-12-30 14:58:49 -08:00
Florian Apolloner c988745cca Changed console and filebackend to use msg.as_bytes to output the data as it would get send via smtp. 2013-12-30 23:46:05 +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 7ed20e0153 Populated Apps instances immediately by default. 2013-12-30 22:11:17 +01:00
Aymeric Augustin 34a215d506 Deprecated the app argument of apps.get_models.
Use app_config.get_models() instead.
2013-12-29 21:48:58 +01:00