Skip to content

Commit ada23ea

Browse files
committed
Add test for return type for distinct GroupConcat
1 parent 640da6f commit ada23ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/testapp/test_aggregates.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ def test_basic_aggregate_ids(self):
7676
out = self.shakes.tutees.aggregate(tids=GroupConcat("id"))
7777
assert out == {"tids": self.str_tutee_ids}
7878

79+
def test_distinct_aggregate_ids(self):
80+
out = self.shakes.tutees.aggregate(tids=GroupConcat("id", distinct=True))
81+
assert out == {"tids": set(self.str_tutee_ids)}
82+
7983
def test_basic_annotate_ids(self):
8084
concat = GroupConcat("tutees__id")
8185
shakey = Author.objects.annotate(tids=concat).get(id=self.shakes.id)

0 commit comments

Comments
 (0)