Commit Graph

3250 Commits

Author SHA1 Message Date
Claude Paroz 6492e8e5e6 Added more precise assertions on two fixture tests. 2012-06-07 14:37:37 +02:00
Claude Paroz 6fd1950a4e Fixed #10200 -- Raised CommandError when errors happen in loaddata. 2012-06-07 10:32:10 +02:00
Aymeric Augustin 4464bbba15 Fixed #14502 -- Added a verbatim template tag.
Thanks SmileyChris for the patch.
2012-06-07 09:59:14 +02:00
Claude Paroz 2c57809a56 Prevented TestNoInitialDataLoading to pollute other tests (Refs #15926)
Tests were still failing with MySQL. It seems a rollback is solving
the issue.
2012-06-06 15:47:48 +02:00
Luke Plant 4fea46a030 Fixed #18309 - Prefetch related does not work for fkey to multitable inherited model
Thanks to milosu for the report, tests and initial patch.
2012-06-06 14:17:32 +01:00
Claude Paroz f0664dc8ae Made TestNoInitialDataLoading pass with MySQL (Refs #15926) 2012-06-06 13:54:40 +02:00
Honza Kral fedac99c85 Fixed #15926 -- Added option --no-initial-data to syncdb and flush.
Thanks msiedlarek, jpaugh64 and vlinhart!
2012-06-05 16:46:15 +02:00
Julien Phalip f699641161 Fixed #17138 -- Made the sensitive_variables decorator work with object methods. 2012-06-03 23:44:13 -07:00
Honza Kral a89034a2d8 Changed FilePathField tests to use it's own directory with test files.
In previous version it used /django/forms/ which was fragile - for some
users .pyc files were not generated and this tests failed.
2012-06-03 22:54:34 +02:00
Honza Kral 71d9a2a7fe Unittest2 style assertTrue instead of assert_ 2012-06-03 22:31:49 +02:00
Honza Kral f823ae3b3e Fixed incorrect assert in test_filepathfield_folders 2012-06-03 21:46:14 +02:00
Claude Paroz 566ac30eb9 Fixed override_settings usage in test_client_regress 2012-06-02 19:50:24 +02:00
Claude Paroz ade44b8d40 Fixed settings override in mail regression tests
self.settings_override from test subclasses were overwriting parent
attribute.
2012-06-02 19:44:15 +02:00
Ramiro Morales d4648a3446 Removed debugging code added in last commit. 2012-06-01 21:50:06 -03:00
Ramiro Morales 72130385bf Made inspectdb tests deal with a smaller generated models.py file.
Implemented this by adding a stealth table_name_filter option for the
command.
2012-06-01 21:46:07 -03:00
Julien Phalip f6fc83c975 Fixed #18409 -- Made RegexField work with unicode characters. 2012-05-31 11:45:35 -07:00
Claude Paroz ea4e0aad9e Cleaned up test_client_regress tests 2012-05-31 17:43:21 +02:00
Claude Paroz 4553f51155 Moved test_client_regress tests from models.py to tests.py 2012-05-31 17:21:13 +02:00
Claude Paroz 0dc904979d Fixed #18407 -- Made model field's to_python methods fully accept unicode.
When generating error message in to_python, any unicode string
containing non-ascii characters triggered a UnicodeEncodeError for
most field types.
2012-05-31 16:46:07 +02:00
Claude Paroz 473c272246 Rewrote test_error_messages with helper test utility. 2012-05-31 16:24:37 +02:00
Claude Paroz 2626ea4a74 Fixed #14681 -- Do not set mode to None on file-like objects.
gzip.GzipFile does not support files with mode set to None.
2012-05-31 10:02:35 +02:00
Julien Phalip 432339a72c Fixed #18393 -- Prevented blocktrans to crash when a variable name is badly formatted. 2012-05-28 11:03:34 -07:00
Claude Paroz a535040bfa Used call_command stdout parameter to capture output in staticfiles tests. 2012-05-28 11:55:38 +02:00
Claude Paroz c3b56c7cdd Used call_command in i18n compilation tests.
Now that call_command does not raise SystemExit any more, we can
use call_command again for testing compilemessages.
2012-05-27 23:11:27 +02:00
Claude Paroz cc4b4d9fd3 Used CommandError in createcachetable command.
Raising CommandError whenever a management command meets an error
condition is the standard way to handle errors in commands.
2012-05-27 23:03:21 +02:00
Claude Paroz f2b6763ad7 Fixed #18387 -- Do not call sys.exit during call_command.
Moved sys.exit(1) so as failing management commands reach it
only when running from command line.
2012-05-27 20:38:47 +02:00
Michael Newman 4423757c0c Fixed #18135 -- Close connection used for db version checking
On MySQL when checking the server version, a new connection could be
created but never closed. This could result in open connections on
server startup.
2012-05-27 18:45:08 +03:00
Anssi Kääriäinen a8a81aae20 Fixed #18343 -- Cleaned up deferred model implementation
Generic cleanup and dead code removal in deferred model field loading
and model.__reduce__().

Also fixed an issue where if an inherited model with a parent field
chain parent_ptr_id -> id would be deferred loaded, then accessing
the id field caused caused a database query, even if the id field's
value is already loaded in the parent_ptr_id field.
2012-05-27 18:11:13 +03:00
Claude Paroz 7a4233b69c Removed a duplicate test in fixtures_regress.
test_abort_loaddata_on_error was exactly the same test as
test_empty (error is tested in test_error_message).
2012-05-26 16:42:28 +02:00
Claude Paroz 3b5083bee5 Fixed #5423 -- Made dumpdata output one row at a time.
This should prevent storing all rows in memory when big sets of
data are dumped.
See ticket for heroic contributors.
2012-05-26 11:43:37 +02:00
Claude Paroz edfa95c22f Specified when open should use binary mode.
Thanks Vinaj Sajip for the help of his django3 branch.
2012-05-25 20:43:43 +02:00
Aymeric Augustin e73838b6dd Fixed #17371 -- Made the test client more flexible
The OPTIONS, PUT and DELETE methods no longer apply arbitrary
data encoding (in the query string or in the request body).
2012-05-25 19:03:15 +02:00
Anssi Kääriäinen 323b414441 Added tests for nested exclude/negate queries 2012-05-25 14:10:45 +03:00
Anssi Kääriäinen 8c72aa2379 Fixed qs.order_by() join promotion for already existing joins
When order_by causes new joins to be added to the query, the joins must
be LEFT OUTER joins for nullable relations, otherwise the order_by
could cause the results to be altered. This commit fixes the logic to
only promote new joins, previously all joins in the order_by lookup
path were promoted.

Thanks to Bruno Desthuilliers for spotting this corner case.
2012-05-24 18:42:06 +03:00
Aymeric Augustin 1e6c3368f2 Fixed #18177 -- Cached known related instances.
This was recently fixed for one-to-one relations; this patch adds
support for foreign keys. Thanks kaiser.yann for the report and
the initial version of the patch.
2012-05-24 13:25:01 +02:00
Aymeric Augustin 3b2993ed04 Fixed #18353 -- Inconsistency in date-based CBVs. 2012-05-24 13:02:19 +02:00
Anssi Kääriäinen 0df4593f0e Fixed #18319 -- Added 'supports_sequence_reset' DB feature
Added a new feature to allow 3rd party backends to skip tests which
test sequence resetting.

Thanks to manfre for report and patch.
2012-05-22 23:51:05 +03:00
Anssi Kääriäinen 8ee1a664f9 Fixed #18318 -- Changed some tests to be 3rd party DB friendly
Thanks to manfre for report and patch.
2012-05-22 23:33:42 +03:00
Anssi Kääriäinen 459c3b67b7 Fixed #18317 -- Removed db specific raw SQL function from tests
A test in model_fields used LEN() in raw SQL. This function is not
available on some 3rd party backends. I removed this function and
ensured that the test works correctly (breaks pre e9bbdb39de) with
the change.
2012-05-22 23:16:24 +03:00
Anssi Kääriäinen d5c7f9efc3 Fixed #18304 -- Optimized save() when update_can_self_select=False
Databases with update_can_self_select = False (MySQL for example)
generated non-necessary queries when saving a multitable inherited
model, and when the save resulted in update.
2012-05-22 20:59:33 +03:00
Aymeric Augustin 03f86a5adb Fixed #18354 -- Performance issue in CBV.
Prevented repeating a query twice when the model isn't ordered by
-date_field (in Meta), allow_empty is False and pagination isn't
enabled.
2012-05-20 13:18:42 +02:00
Claude Paroz 38408f8007 Marked bytestrings with b prefix. Refs #18269
This is a preparation for unicode literals general usage in
Django (Python 3 compatibility).
2012-05-19 17:43:34 +02:00
Claude Paroz 822d6d6dab Fixed #18325 -- Wrapped self.stdout/stderr in OutputWrapper class 2012-05-19 13:51:54 +02:00
Claude Paroz 45f55a9fcc Fixed broken ES localflavor test after 4774875. 2012-05-18 13:45:42 +02:00
Claude Paroz 7549de841c Fixed #18334 -- Fixed detection of supports_stddev backend feature.
Thanks to Michael Manfre for the report and Anssi Kääriäinen for the
review.
2012-05-18 12:12:45 +02:00
Aymeric Augustin ab268e1848 Added a test for DayArchiveView. Refs #17192. 2012-05-17 17:53:19 +02:00
Aymeric Augustin dcd4383107 Fixed #9893 -- Validated the length of file names
after the full file name is generated by the storage class.

Thanks Refefer for the report, carsongee for the patch, and
everyone else involved in the discussion.
2012-05-17 16:02:05 +02:00
Aymeric Augustin c4996df16c Fixed #17449 -- Added OPTIONS to generic views.
Thanks estebistec for the report and patch.
2012-05-17 13:54:51 +02:00
Aymeric Augustin 009e237cf0 Fixed #17535 -- Optimized list generic views.
When allow_empty is False, prevented the view from loading
the entire queryset in memory when pagination is enabled.
2012-05-17 13:34:53 +02:00
Claude Paroz 006c2b8fc1 Fixed #18326 -- Stripped ending chars in LiveServerViews tests.
Ending chars might be different depending on git crlf setting.
Thanks Michael Manfre for the report and the patch.
2012-05-17 11:10:48 +02:00