Skip to content

Commit

Permalink
Add test for return type for distinct GroupConcat
Browse files Browse the repository at this point in the history
  • Loading branch information
javiplx committed Jun 1, 2020
1 parent 640da6f commit ada23ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/testapp/test_aggregates.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def test_basic_aggregate_ids(self):
out = self.shakes.tutees.aggregate(tids=GroupConcat("id"))
assert out == {"tids": self.str_tutee_ids}

def test_distinct_aggregate_ids(self):
out = self.shakes.tutees.aggregate(tids=GroupConcat("id", distinct=True))
assert out == {"tids": set(self.str_tutee_ids)}

def test_basic_annotate_ids(self):
concat = GroupConcat("tutees__id")
shakey = Author.objects.annotate(tids=concat).get(id=self.shakes.id)
Expand Down

0 comments on commit ada23ea

Please sign in to comment.