Commit Graph

3991 Commits

Author SHA1 Message Date
Claude Paroz cbfb8ed53b Fixed a regression in forms changed_data
Thanks Loic Bistuer for spotting the regression and the initial
patch. Refs #16612.
2013-03-08 18:19:24 +01:00
Loic Bistuer 6983a1a540 Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that return a QuerySet. 2013-03-08 10:11:45 -05:00
Aymeric Augustin 477d737e1e Merge pull request #850 from bmispelon/ticket-19916
Fix 19916. Smarter tokenizing of contrib.comment's templatetags arguments
2013-03-07 12:12:29 -08:00
Alex Gaynor bbbd698c7a Added a ManyToManyField(db_constraint=False) option, this allows not creating constraints on the intermediary models. 2013-03-07 11:24:51 -08:00
Baptiste Mispelon 81804ae474 Fix 19916. Smarter tokenizing of contrib.comment's templatetags arguments. 2013-03-07 19:30:38 +01:00
Claude Paroz 4cccb85e29 Fixed #19997 -- Added custom EMPTY_VALUES to form fields
Thanks Loic Bistuer for the report and the patch.
2013-03-07 15:22:03 +01:00
Igor Támara e2ee02c5bd Fixed #19951 -- Admin: Invalid model PK values shouldn't cause 500 status.
Avoid ValueError in admin when passing a string as PK for an inherited
model with an integer PK field.

Thanks ikks for the patch. See also #11191.
2013-03-06 21:38:44 -03:00
Ramiro Morales c31a9793c6 Merge pull request #882 from loic/testfix
Fixed minor warnings in tests.
2013-03-06 16:22:06 -08:00
Preston Holmes 876fc39128 PEP8 cleanup of functional.py 2013-03-06 16:14:46 -08:00
Preston Holmes 0ea5bf88dd Fixed #19543 -- implemented SimpleLazyObject.__repr__
Thanks to Florian Hahn for the patch
2013-03-06 16:13:12 -08:00
Aymeric Augustin b3aa853ec5 Used more precise test assertions. 2013-03-06 15:33:35 +01:00
Loic Bistuer 9ba0e4e4ee Fixed minor warnings in tests. 2013-03-06 01:13:36 +07:00
Juan Pedro Fisanotti d9330d5be2 Fixed #6585 -- Admin relationship widgets: Respect ordering defined by target model's ModelAdmin.
Thanks Gary Wilson for the report and Juan Pedro Fisanotti, Carlos
Matías de la Torre for the fix.
2013-03-04 18:08:53 -03:00
Javier Mansilla 3ea0c7d35a Fixed #19838 -- Admin: Don't leak a 500 HTTP status when trying to delete protected FKs.
Thanks rafadev for the report and Javier Mansilla for the fix.
2013-03-04 13:30:59 -03:00
Ramiro Morales 60dd4eabe7 Removed mentions of modeltests. 2013-03-03 18:44:06 -03:00
matiasb 804366327d Fixed #19915 - Made blocktrans tag honor TEMPLATE_STRING_IF_INVALID.
Thanks Natalia Bidart for the report and Matías Bordese for the fix.
2013-03-03 16:10:11 -03:00
Claude Paroz 384c180e41 Fixed #19917 -- Added microseconds in default TIME_INPUT_FORMATS
Thanks minddust for the report.
2013-03-02 18:11:10 +01:00
Aymeric Augustin e0449316eb Fixed #18130 -- Made the isolation level configurable on PostgreSQL.
Thanks limscoder for the report and niwi for the draft patch.
2013-03-02 15:05:49 +01:00
Claude Paroz c5a25c2771 Add introspection support for BinaryField 2013-03-02 10:29:03 +01:00
Claude Paroz d680a3f447 Added support for serializing BinaryField 2013-03-02 10:29:02 +01:00
Claude Paroz 8ee1eddb7e Add a BinaryField model field
Thanks Michael Jung, Charl Botha and Florian Apolloner for review
and help on the patch.
2013-03-02 10:29:02 +01:00
Simon Charette 0f306cad84 Import `CaptureQueriesContext` from its original module. 2013-03-02 03:45:42 -05:00
Simon Charette fb3d85bd14 Fixed #10399 -- Tested that o2o field updates are not constrained by an inner query. 2013-03-02 03:24:08 -05:00
Simon Charette 952ba5237e Added a context manager to capture queries while testing.
Also made some import cleanups while I was there.

Refs #10399.
2013-03-02 02:41:14 -05:00
Claude Paroz 3318595c0b Fixed #18898 -- Added tests with a fix for ModelMultipleChoiceField 2013-03-01 09:35:18 +01:00
Claude Paroz 892bc91cb0 Fixed #16612 -- Improved has_changed detection for localized field values
Thanks Simon Charette for the review.
2013-03-01 09:35:04 +01:00
Aymeric Augustin cf30469164 Fixed tests broken in 2ee21d9. 2013-02-28 17:08:16 +01:00
Aymeric Augustin 2ee21d9f0d Implemented persistent database connections.
Thanks Anssi Kääriäinen and Karen Tracey for their inputs.
2013-02-28 15:28:13 +01:00
Aymeric Augustin aa089b106b Fixed #5241 -- Kept active transalation in LocaleMiddleware.process_response. 2013-02-28 14:21:48 +01:00
Anssi Kääriäinen 06de130dae Fixed #12823 -- Was already fixed in master, tests added
Also added a little improvement to sql/query.py to get rid of
non-necessary IS NOT NULL check.
2013-02-28 15:05:48 +02:00
Łukasz Langa af3321a1e8 use the real path to fix OS X /var/folders vs. /private/var/folders mismatch 2013-02-27 23:33:47 +01:00
Anssi Kääriäinen 21189cb80b Made dateformat tests reactivate original language 2013-02-27 23:48:17 +02:00
Aymeric Augustin 7aaa8a7779 Fixed a test that relied on database exceptions not being wrapped. 2013-02-27 21:12:48 +01:00
Aymeric Augustin b2c697b029 Fixed a PendingDeprecationWarning in template_tests. 2013-02-27 21:09:27 +01:00
Anssi Kääriäinen 50328f0a61 Fixed #19861 -- Transaction ._dirty flag improvement
There were a couple of errors in ._dirty flag handling:
  * It started as None, but was never reset to None.
  * The _dirty flag was sometimes used to indicate if the connection
    was inside transaction management, but this was not done
    consistently. This also meant the flag had three separate values.
  * The None value had a special meaning, causing for example inability
    to commit() on new connection unless enter/leave tx management was
    done.
  * The _dirty was tracking "connection in transaction" state, but only
    in managed transactions.
  * Some tests never reset the transaction state of the used connection.
  * And some additional less important changes.

This commit has some potential for regressions, but as the above list
shows, the current situation isn't perfect either.
2013-02-27 17:54:27 +02:00
Łukasz Langa 40b9f4fb8b [py3] Always fed hashlib with bytes. 2013-02-27 10:02:07 +01:00
Ramiro Morales a28e2e7c4d Removed a .mo file incorrectly put under Git control. 2013-02-26 22:45:08 -03:00
Ramiro Morales f0bd553922 Simplified compilemessages tests a bit. 2013-02-26 22:30:49 -03:00
Ramiro Morales dfa9324966 Don't use os.system() in compilemessages.
Fixes #19584.

This implies stop storing file path command line arguments in envvars as
a security measure to start relying on with Popen's shell=False instead,
and addition of an 'utils' module.

Thanks kmichel_wgs for the report.
2013-02-26 21:31:53 -03:00
Claude Paroz 58a2fc820e Fixed i18n test to match changed translation
Forward port of ab6ff2e0ac from stable/1.5
2013-02-26 21:51:06 +01:00
Florian Apolloner 33234aa8f7 Fixed discovery of the Django installation during tests.
If Django was symlinked into site-packages the previous approach to discover
the tests subdirectory would fail. The revised version now always points to
the location of the source and not the import path.
2013-02-26 21:04:32 +01:00
Florian Apolloner 0fe11fca40 Changed test_runner tests to use full python path for settings files. 2013-02-26 16:02:24 +01:00
Florian Apolloner 1535fcfdba fixed admin_scripts tests on python 3.3 2013-02-26 15:38:11 +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 4d9f39f307 Renamed a template to be found by the loaders. 2013-02-26 14:36:58 +01:00
Florian Apolloner 33836cf88d Renamed some tests and removed references to modeltests/regressiontests. 2013-02-26 14:36:57 +01:00
Florian Apolloner 737a5d71f0 Adjusted coveragerc 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 89f40e3624 Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00
Florian Apolloner b3d2ccb5bf Removed __init__.py files. 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
Aymeric Augustin 8dd8400f7e Updated an inaccurate comment.
Tests can run nearly as fast under PostgreSQL and MySQL as under SQLite
with a bit of configuration and the speedup is always a good thing.
2013-02-26 10:00:14 +01:00
Carl Meyer 6a8f95d812 Fixed a caching test on Python 3. 2013-02-25 18:12:55 -07:00
Łukasz Langa 6a057e1595 Fixed #18191 -- Don't consider Accept-Language redundantly in cache key.
Thanks to choongmin for the original patch.
2013-02-25 16:10:57 -07:00
Aymeric Augustin e76147a83a Fixed #19634 -- Added proper __hash__ methods.
Classes overriding __eq__ need a __hash__ such that equal objects have
the same hash.

Thanks akaariai for the report and regebro for the patch.
2013-02-25 23:05:20 +01:00
Carl Meyer 509798ae06 Use built-in fixture support rather than calling loaddata in setUp(). 2013-02-25 12:13:10 -07:00
Aymeric Augustin 86b96038f2 Merge pull request #847 from fhahn/ticket_18176
Fixed #18176 -- Added test for year lookups with year < 1000
2013-02-25 09:26:56 -08:00
Carl Meyer 906dc8522a Fixed #19854 -- Turn Django's own Selenium tests off by default. 2013-02-25 10:14:42 -07:00
Florian Hahn f28c301a47 Fixed #18176 -- Added test for year lookups with year < 1000
Thanks Tomas Ehrlich for the initial test
2013-02-25 17:13:27 +01:00
Claude Paroz 6d52bcbb7c Fixed #19903 -- Fixed unbalanced setUp/tearDown calls in LiveServerAddress test 2013-02-25 08:58:11 +01:00
Aymeric Augustin 7b49da1c38 Changed testing strategy used in 6b03179e.
Avoid polluting the app cache as it causes unrelated test failures.

Refs #19688.
2013-02-25 00:09:13 +01:00
Julien Phalip ae2a8bb456 Fixed a test that was failing in Python 3.
The issue was that as of Python 3, the generators' `next()`
method becomes `__next()`. Thanks Alex Gaynor for noticing that.
Refs #19890.
2013-02-24 13:47:14 -08:00
Julien Phalip a8449d4362 Merge pull request #824 from ambv/languagecode 2013-02-24 12:56:14 -08:00
Simon Charette 6b03179e12 Fixed #19688 -- Allow model subclassing with a custom metaclass using six.with_metaclass 2013-02-24 17:32:34 +01:00
Christopher Medrela 636c45fc58 Fixed #19890 -- ifchanged templatetag rendered its content twice
The content of ifchanged template tag was rendered twice: first time, to
compare it with the previous value and the second time, to return the
rendered output.
2013-02-24 16:49:28 +01:00
Diederik van der Boor 8503120c10 Fixed #15849 -- Made IfChanged node thread safe.
Previously, the ifchanged node stored state on `self._last_seen`,
thereby giving undesired results when the node is reused by another
thread at the same time (e.g. globally caching a Template object).

Thanks to akaihola for the report and Diederik van der Boor and
Bas Peschier for the patch.
2013-02-24 16:06:55 +01:00
Zbigniew Siciarz 0a8402eb05 Test case and docs for custom context data in feeds
Thanks Paul Winkler for the initial patch. (Ref #18112).
2013-02-24 08:33:20 -06:00
Florian Apolloner 4506ae0497 Merge pull request #717 from slurms/ticket_19746
Fixed #19746 -- Allow deserialization of pk-less data
2013-02-24 06:31:14 -08:00
Łukasz Langa 8c8f94fe9d Fixes #19763 - LocaleMiddleware should check for supported languages in settings.LANGUAGE_CODE 2013-02-24 14:43:45 +01:00
Tomek Paczkowski 99edbe0e27 Fixed #19253 -- Extracted template cache key building logic
Introduced a public function
django.core.cache.utils.make_template_fragment_key
Thanks @chrismedrela for fruitful cooperation.
2013-02-24 14:32:45 +01:00
Aymeric Augustin 7106a1e594 Merge pull request #819 from erikr/master
Fixed #16302 -- Ensured contrib.comments is IPv6 capable.
2013-02-24 05:02:00 -08:00
Erik Romijn ade992c61e Fixed #16302 -- Ensure contrib.comments is IPv6 capable
Changed the ip_address field for Comment to GenericIPAddressField. Added
instructions to the release notes on how to update the schema of existing
databases.
2013-02-24 13:58:38 +01:00
Bas Peschier 5a9b2bce24 Fixed #19810 -- MemcachedCache now uses pickle.HIGHEST_PROTOCOL 2013-02-24 13:56:15 +01:00
Wiktor Kolodziej f07a5f0a21 Fixed #11295: If ModelAdmin.queryset returns a filtered QS don't require a 2nd count call
Original patch rewritten, added tests and get_filters_params method for ChangeList class.
Thanks Alex for the report.
2013-02-24 13:23:23 +01:00
Florian Apolloner e4ee3d8fca Fixed a few ResourceWarnings. 2013-02-24 13:11:19 +01:00
Honza Král e4e1287590 Merge pull request #817 from rybaktomasz/ticket_5568
Fixes #5568 -- DROP INDEX subcommand
2013-02-24 04:02:26 -08:00
Honza Kral cbb9f629b8 Revert "fixes #19263" - Fails if not SQLite
This reverts commit 2b76f19f2b.
2013-02-24 12:38:32 +01:00
Tomasz Rybak d7429defe6 Add sqldropindexes to manage
Change patch from https://code.djangoproject.com/ticket/5568
to work on modern Django.
Add special case for MySQL which has different syntax for DROP INDEX.
Add unit tests for the new functionality.
2013-02-24 12:38:28 +01:00
Honza Kral 5a6a4249f3 Removing unneeded tearDown code. 2013-02-24 12:31:00 +01:00
George Song 44164c5c30 Fixed #19896 -- Committed after clearing cache in the database. 2013-02-24 12:15:02 +01:00
Florian Apolloner f56ca3f0e6 Fixed the usage of the deprecated assertEquals. 2013-02-24 11:15:17 +01:00
Aymeric Augustin c10ed58746 Caught warnings in the templates tests. Refs #17906.
This was missing from f49e9a517f.
2013-02-24 10:28:05 +01:00
Honza Král fc38d6a92b Merge pull request #813 from HiddenData/ticket-19263
fixes #19263 - EmptyResultSet in subquery causes incorrect SQL
2013-02-23 15:05:24 -08:00
Marcin Biernat 2b76f19f2b fixes #19263 2013-02-23 23:53:46 +01:00
Honza Král 692902b227 Merge pull request #778 from viciu/19609
Fixed #19609: admin Inlines doesn't display help_text for readonly fields
2013-02-23 14:34:57 -08:00
Honza Kral ef1e6ef1eb Merge branch 'ticket19872' of https://github.com/oinopion/django 2013-02-23 23:32:09 +01:00
Honza Kral 2b48fcc607 Fixed #18491 -- deleting a proxy doesn't show warning about cascade deletes 2013-02-23 23:20:34 +01:00
Tomek Paczkowski b88abd6840 Fixed #19872
Made cached_property to behave as property when accessed via class.
2013-02-23 23:20:00 +01:00
Aleksandra Sendecka 32a7ab2148 Fixed #19526
CSS specifications governs that syntax is case insensitive.
This modifies CachedFilesMixin to support that.
2013-02-23 23:05:22 +01:00
Klaas van Schelven 1c11ee6345 Fixed #18829 -- Fixed ModelChoiceIterator length
Thanks facundo.olano at gmail.com for the report and thikonom for
the initial patch.
2013-02-23 22:27:07 +01:00
Alex Gaynor 150e202172 Some style fixes for stuff that was clearly brough tover from doctests. 2013-02-23 13:04:08 -08:00
Honza Král 10026c2ad0 Merge pull request #804 from oinopion/ticket18162
Fixes #18162 --  Specifying choices to Field overrides any form_class argument
2013-02-23 12:45:39 -08:00
Grzegorz Nosek 2cd0edaa47 Fixed 19895 -- Made second iteration over invalid queryset raise an exception too
When iteration over a queryset raised an exception, the result cache
remained initialized with an empty list, so subsequent iterations returned
an empty list instead of raising an exception
2013-02-23 14:35:27 -06:00
Łukasz Langa 539900f117 Fixes #17866: Vary: Accept-Language header when language prefix used 2013-02-23 19:41:33 +01:00
Honza Kral bfd4a71d41 One last final fix for 0ad76843. Tested on py3 and py2 2013-02-23 19:27:37 +01:00
Honza Král 0a341ab40d Merge pull request #791 from khalas/ticket_19811
Changed %r to %s in get_language_info error message
2013-02-23 10:16:23 -08:00
Tomek Paczkowski b6f4a92ff4 Proposed fix for #18162. 2013-02-23 19:01:38 +01:00
Konrad Hałas 48dc0cbf2a Changed %r to %s in get_language_info error message. 2013-02-23 18:54:54 +01:00
Florian Apolloner f368c25f10 Fixed errors introduced in 664855b74e 2013-02-23 18:47:36 +01:00
Florian Apolloner 5ae0c933a8 Fixed errors introduced in 21f333bcef. Refs #17751 2013-02-23 18:43:34 +01:00