Skip to content

Commit

Permalink
add range lookup test for EmbeddedModelField
Browse files Browse the repository at this point in the history
  • Loading branch information
WaVEV authored and timgraham committed Jan 23, 2025
1 parent 0aa6e73 commit a7458c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/model_fields_/test_embedded_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def test_gt(self):
def test_gte(self):
self.assertCountEqual(Holder.objects.filter(data__integer__gte=3), self.objs[3:])

def test_range(self):
self.assertCountEqual(Holder.objects.filter(data__integer__range=(2, 4)), self.objs[2:5])

def test_order_by_embedded_field(self):
qs = Holder.objects.filter(data__integer__gt=3).order_by("-data__integer")
self.assertSequenceEqual(qs, list(reversed(self.objs[4:])))
Expand Down

0 comments on commit a7458c2

Please sign in to comment.