Skip to content

Commit

Permalink
simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
WaVEV committed Jan 23, 2025
1 parent b7d5f95 commit b898209
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tests/model_fields_/test_embedded_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,7 @@ def test_order_and_group_by_embedded_field(self):
)

def test_range_query(self):
sorted_obj = sorted(self.objs, key=lambda x: x.data.auto_now)
queryset = Holder.objects.filter(data__integer__range=(2, 6)).order_by("data__auto_now")
self.assertEqual(queryset.count(), 4)
expected_objs = sorted(truncate_ms(e.data.auto_now) for e in sorted_obj[2:])
self.assertQuerySetEqual(queryset, expected_objs, lambda h: h.data.auto_now)
self.assertCountEqual(Holder.objects.filter(data__integer__range=(2, 5)), self.objs[2:6])

def test_order_and_group_by_embedded_field_annotation(self):
# Create repeated `data__integer` values.
Expand Down

0 comments on commit b898209

Please sign in to comment.