Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected exception types in QuerySet docs. #13411

Merged
merged 2 commits into from Sep 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions docs/ref/models/querysets.txt
Expand Up @@ -644,7 +644,7 @@ A few subtleties that are worth mentioning:
ignored.

* Calling :meth:`only()` and :meth:`defer()` after ``values()`` doesn't make
sense, so doing so will raise a ``NotImplementedError``.
sense, so doing so will raise a ``TypeError``.
felixxm marked this conversation as resolved.
Show resolved Hide resolved

* Combining transforms and aggregates requires the use of two :meth:`annotate`
calls, either explicitly or as keyword arguments to :meth:`values`. As above,
Expand Down Expand Up @@ -3491,8 +3491,7 @@ documentation to learn how to create your aggregates.
SQLite can't handle aggregation on date/time fields out of the box.
This is because there are no native date/time fields in SQLite and Django
currently emulates these features using a text field. Attempts to use
aggregation on date/time fields in SQLite will raise
``NotImplementedError``.
aggregation on date/time fields in SQLite will raise ``NotSupportedError``.
felixxm marked this conversation as resolved.
Show resolved Hide resolved

.. admonition:: Note

Expand Down
4 changes: 1 addition & 3 deletions tests/backends/sqlite/tests.py
Expand Up @@ -37,9 +37,7 @@ def test_check_sqlite_version(self):
check_sqlite_version()

def test_aggregation(self):
"""
Raise NotImplementedError when aggregating on date/time fields (#19360).
"""
"""Raise NotSupportedError when aggregating on date/time fields."""
for aggregate in (Sum, Avg, Variance, StdDev):
with self.assertRaises(NotSupportedError):
Item.objects.all().aggregate(aggregate('time'))
Expand Down