Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions django/db/backends/sqlite3/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,3 @@ def setup_worker_connection(self, _worker_id):
# connection.
self.connection.connect()
target_db.close()
if os.environ.get("RUNNING_DJANGOS_TEST_SUITE") == "true":
self.mark_expected_failures_and_skips()
8 changes: 1 addition & 7 deletions django/db/models/sql/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2346,13 +2346,7 @@ def clear_ordering(self, force=False, clear_default=True):
query (not even the model's default).
"""
if not force and (
self.is_sliced
or self.distinct_fields
or self.select_for_update
or (
isinstance(self.group_by, tuple)
and not {*self.order_by, *self.extra_order_by}.issubset(self.group_by)
)
self.is_sliced or self.distinct_fields or self.select_for_update
):
return
self.order_by = ()
Expand Down
5 changes: 5 additions & 0 deletions django/test/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,11 @@ def _init_worker(
if value := serialized_contents.get(alias):
connection._test_serialized_contents = value
connection.creation.setup_worker_connection(_worker_id)
if (
is_spawn_or_forkserver
and os.environ.get("RUNNING_DJANGOS_TEST_SUITE") == "true"
):
connection.creation.mark_expected_failures_and_skips()

if is_spawn_or_forkserver:
call_command(
Expand Down
19 changes: 0 additions & 19 deletions tests/aggregation_regress/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,25 +171,6 @@ def assertObjectAttrs(self, obj, **kwargs):
for attr, value in kwargs.items():
self.assertEqual(getattr(obj, attr), value)

def test_count_preserve_group_by(self):
# new release of the same book
Book.objects.create(
isbn="113235613",
name=self.b4.name,
pages=self.b4.pages,
rating=4.0,
price=Decimal("39.69"),
contact=self.a5,
publisher=self.p3,
pubdate=datetime.date(2018, 11, 3),
)
qs = Book.objects.values("contact__name", "publisher__name").annotate(
publications=Count("id")
)
self.assertEqual(qs.count(), Book.objects.count() - 1)
self.assertEqual(qs.order_by("id").count(), Book.objects.count())
self.assertEqual(qs.extra(order_by=["id"]).count(), Book.objects.count())

def test_annotation_with_value(self):
values = (
Book.objects.filter(
Expand Down