Commit Graph

652 Commits

Author SHA1 Message Date
Jannis Leidel 538257b4ae Fixed #10080 -- Slightly extended the fix made in r10401 by also taking command line options into account that don't have have a default set. Thanks, Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17467 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-09 18:56:41 +00:00
Julien Phalip d02ba7f4ee Fixed #11670 -- Prevented genuine model fields named 'year', 'month', 'gt', 'lt' etc. from being mistaken for lookup types in lookups across relations. Thanks to andy for the report, to jpwatts for the initial patch and to Anssi Kääriäinen and Alex Gaynor for the reviews.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17450 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-05 07:11:53 +00:00
Julien Phalip d3154d1896 Fixed #8291 -- Allowed 'pk' to be used as an ordering option in `Model.Meta`. Thanks to peterd12 for the report and to evan_schulz, gruszczy, frog32 and David Gouldin for their work on the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17445 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-04 19:56:40 +00:00
Jannis Leidel 62efdcb037 Fixed #17602 -- Stopped the XML serializer from doing unneeded queries. Thanks, gnosek.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17439 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-04 18:27:07 +00:00
Jannis Leidel 2b0c1ea641 Fixed #17527 -- Improved exception message when adding the wrong type of object to a ManyToManyField. Thanks, guettli and cClaude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17437 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-04 16:06:09 +00:00
Carl Meyer 844a24bbb9 Fixed #16921 -- Added assertHTMLEqual and assertHTMLNotEqual assertions, and converted Django tests to use them where appropriate. Thanks Greg Müllegger.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17414 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-31 20:36:11 +00:00
Aymeric Augustin c82f1dcf95 Skipped the test introduced at r17403 on Python 2.5, because it requires warnings.catch_warnings.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17413 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-31 19:47:40 +00:00
Aymeric Augustin 58bcb7d161 Caught (and tested) the warning added at r17393 in the corresponding test. Refs #17580.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17403 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-28 20:34:02 +00:00
Jannis Leidel 8f168976d6 Fixed #17580 -- Made sure datetime.date instances are correctly handled when being passed to a DateTimeField fields and the timezone support is enabled by making it aware using the default timezone.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17392 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-24 10:00:39 +00:00
Aymeric Augustin aa5d307da6 Fixed #17100 -- Typo in the regex for EmailValidator. Thanks reames AT asymmetricventures com for the report and Claude Paroz for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17349 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-07 18:43:46 +00:00
Julien Phalip 31b1cbc623 Fixed #16340 -- Made `get_or_create()` re-raise any `IntegrityError` with its original traceback. Thanks to d0ugal and Jonas Obrist.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17333 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-02 21:30:47 +00:00
Aymeric Augustin fc9e0606d5 Fixed a stupid bug in the implementation of timezone.make_aware.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17332 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-02 20:45:09 +00:00
Aymeric Augustin a62ce30661 Fixed #17463 -- Conditionally skipped tests that Windows isn't able to run.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17278 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-27 09:28:50 +00:00
Ramiro Morales 287565779d Added support for modifying the effect of ``DISTINCT`` clauses so they
only consider some fields (PostgreSQL only).

For this, the ``distinct()`` QuerySet method now accepts an optional
list of model fields names and generates ``DISTINCT ON`` clauses on
these cases. Thanks Jeffrey Gelens and Anssi Kääriäinen for their work.

Fixes #6422.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17244 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-22 20:42:40 +00:00
Adrian Holovaty 20c8aa2a20 Fixed various dodgy behaviours
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-17 17:37:24 +00:00
Adrian Holovaty 3f003a3c4b Fixed #17323 -- Renamed HttpRequest.raw_post_data to request.body. Thanks for the patch, dstufft
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17210 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-16 23:40:32 +00:00
Aymeric Augustin 545c3159f5 Fixed #17251 -- In the select_for_update tests, close manually database connections made in threads, so they don't stay "idle in transaction" until the GC deletes them. Thanks Anssi Kääriäinen for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-11 08:43:01 +00:00
Aymeric Augustin 33bb3cd47c Fixed #17343 -- Changed the {% now %} tag to use the current time zone when time zone support is enabled. Thanks oinopion for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17169 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-04 22:11:12 +00:00
Aymeric Augustin fb7ab7730d Changed the fixtures used to test the 'initial_data' feature so they don't contain datetimes. Refs #17275.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17154 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-27 13:00:56 +00:00
Aymeric Augustin 02bc523b89 Renamed the fixtures used by the aggregation tests so they're only loaded by the tests that use them. Refs #17275.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-27 10:31:26 +00:00
Aymeric Augustin 866c229f52 Fixed #17294 -- Supported nullable DateTimeFields when time zone support is enabled. Thanks pressureman for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17148 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-25 09:25:43 +00:00
Aymeric Augustin 43c5d35315 Fixed #17274 -- Accepted TIME_ZONE = None when USE_TZ = True. Thanks pressureman for the report.
This problem only occured when pytz is installed. It's still strongly recommended to define the correct time zone in TIME_ZONE in order to use pytz' implementation and not the approximation based on system time.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@17134 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-21 12:42:09 +00:00
Aymeric Augustin 37b7f00fd0 Ensured that the warning added at r17117 also applies to queryset filter arguments. Refs #17263.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17126 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-20 15:29:39 +00:00
Aymeric Augustin f6ee168919 Disabled tests that require warnings.catch_warnings when running under Python 2.5.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17118 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-20 07:40:19 +00:00
Aymeric Augustin 9c30d48b45 Fixed #17263 -- Added a warning when a naive datetime reaches the database layer while time zone support is enabled.
After this commit, timezones.AdminTests will raise warnings because the sessions contrib app hasn't been upgraded to support time zones yet.
This will be fixed in an upcoming commit.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@17117 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-19 23:27:20 +00:00
Jannis Leidel 6f66b55108 Fixed #17255 -- Removed "as" prefix from new timezone template filter names for the sake of clarity. Cheers to Aymeric Augustin for bearing with me.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17107 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-18 15:00:08 +00:00
Aymeric Augustin 9b1cb755a2 Added support for time zones. Thanks Luke Plant for the review. Fixed #2626.
For more information on this project, see this thread:
http://groups.google.com/group/django-developers/browse_thread/thread/cf0423bbb85b1bbf



git-svn-id: http://code.djangoproject.com/svn/django/trunk@17106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-18 13:01:06 +00:00
Karen Tracey 5de31cb8cb Refs #17215: Avoid generating 47 leftover tmp dirs during a clean test run.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-13 19:05:02 +00:00
Karen Tracey efe4e2e517 Fix #16570: Restore ability to have decimal fields where max_digits equals decimal_places. Thanks dcwatson and kenth.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17089 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-12 19:53:56 +00:00
Karen Tracey 63ba472cc4 Fix #13864: Removed database error raised when force_update is requsted on save of an inherited model with no fields of its own. Thanks fva, gregmuellegger, and markb1.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-12 19:06:39 +00:00
Ramiro Morales f1bc3b0401 Fixed incompatibility with Python 2.5 introduced in r17077. Thanks Florian for the heads up.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17078 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-09 17:39:07 +00:00
Ramiro Morales e92b3b723f Fixed #11118 -- Made management command BaseCommand restore locale after execution.
Thanks rvdrijst for the report and initial patch and Claude Paroz for enhancing it.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17077 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-07 11:28:31 +00:00
Aymeric Augustin d71b4309ca Used yaml.safe_load instead of yaml.load, because safety should be the default.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17062 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-01 20:07:42 +00:00
Julien Phalip 977316e0cb Fixed #16816 -- Tweaked the test mock for `URLField.verify_exists` to allow tests to pass when there is no Internet connection available. Many thanks to Ramiro Morales, Aymeric Augustin and Florian Apolloner for the patch reviews.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17059 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-31 11:09:10 +00:00
Julien Phalip b87114962f Tweaked some `AutoField` tests to not raise wanings in Python>=2.6, where `BaseException.message` has been deprecated.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-28 04:11:41 +00:00
Ramiro Morales da5c766dbb Tweaked test added in r16873 so it also works with Oracle.
* Changed invalid fixture from trying to insert a NULL value in a
  null=False CharField to try with a DateTimeField instead because our
  Oracle backend allows NULLs for CharFields than can be blank and that
  insert wouldn't generate an error.

* cx_Oracle raises a
  `DatabaseError: Could not load fixtures.Article(pk=1): ORA-01407: cannot update ("USER_DEFAULT"."FIXTURES_ARTICLE"."PUB_DATE") to NULL'`
  instead of an IntegrityError like the rest of the DB-API drivers we
  support, changed the error message we test for to start simply with
  'Error' to catch both messages.

  We might want to consider converting DatabaseError to IntegrityError
  in the backend when the error code is ORA-1407.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17002 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-17 03:29:07 +00:00
Aymeric Augustin b7f2aba566 Fixed a test that relied on the database to reject invalid data; MySQL doesn't. Refs #17055.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16996 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-16 14:30:43 +00:00
Julien Phalip d3cd9c0d06 Made an `AutoField` test more robust.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-16 06:57:25 +00:00
Aymeric Augustin c582609c8d Modified the tablespaces tests so that they no longer rely on settings.DEFAULT_INDEX_TABLESPACE being empty. Refs #12308.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16990 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-15 15:54:53 +00:00
Aymeric Augustin a8e1d134a5 Fixed a test failure introduced at r16987. Refs #12308.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16988 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-15 09:00:31 +00:00
Aymeric Augustin 246580573d Fixed #12308 -- Added tablespace support to the PostgreSQL backend.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-14 21:49:43 +00:00
Alex Gaynor 69e1e6187a Switch several assertNumQueries to use the context manager, which is much more beautiful.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16986 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-14 17:03:08 +00:00
Alex Gaynor d5a45d79fe Convert all modeltests to use absolute imports, rather than relative ones.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16975 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13 18:04:12 +00:00
Alex Gaynor 43920cd32e Remove a handful of `import *` from the tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16973 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13 12:53:02 +00:00
Julien Phalip c58e5724bc Fixed a couple of `assert` syntax warnings mistakingly introduced in r16966 and added some tests to prevent future regressions. Thanks to Anssi Kääriäinen for the report.
Refs #12467.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13 11:53:59 +00:00
Julien Phalip 3b22c68343 Fixed #12467 -- Made the model data validation for `DateField` and `DateTimeField` more useful by actually telling what was the value that failed. Also did a bit of PEP8 cleanup in the area. Thanks to knutin for the report, to raulcd for the initial patch and to charettes for the review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16966 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13 08:11:00 +00:00
Luke Plant 052a011ee6 Fixed #17003 - prefetch_related should support foreign keys/one-to-one
Support for `GenericForeignKey` is also included.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-07 16:05:53 +00:00
Luke Plant 662eea116f Fixed #16937 - added `QuerySet.prefetch_related` to prefetch many related objects.
Many thanks to akaariai for lots of review and feedback, bug finding,
additional unit tests and performance testing.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16930 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-05 23:14:52 +00:00
Ian Kelly 21a449168b Fixed #16645: fixed a broken test to work in Oracle.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16919 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-30 21:40:56 +00:00
Ramiro Morales bf05da876a Fixed #8160 -- Made sure `modelformset_factory` takes in account `fields' and `exclude` ModelForm options.
Thanks Andrew McMurry for the report and Claude Paroz for creating these tests.

(Actually, this had been fixed in r10619 but the tests added then exercise the
code in the context of ModelAdmin. This commit adds more generic tests.)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16918 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-30 20:53:39 +00:00