diff --git a/tests/regressiontests/aggregation_regress/fixtures/aggregation_regress.json b/tests/regressiontests/aggregation_regress/fixtures/aggregation_regress.json
index 597ac04..f858643 100644
a
|
b
|
|
165 | 165 | "fields": { |
166 | 166 | "age": 34, |
167 | 167 | "friends": [2, 4], |
| 168 | "living": true, |
168 | 169 | "name": "Adrian Holovaty" |
169 | 170 | } |
170 | 171 | }, |
… |
… |
|
174 | 175 | "fields": { |
175 | 176 | "age": 35, |
176 | 177 | "friends": [1, 7], |
| 178 | "living": true, |
177 | 179 | "name": "Jacob Kaplan-Moss" |
178 | 180 | } |
179 | 181 | }, |
… |
… |
|
183 | 185 | "fields": { |
184 | 186 | "age": 45, |
185 | 187 | "friends": [], |
| 188 | "living": true, |
186 | 189 | "name": "Brad Dayley" |
187 | 190 | } |
188 | 191 | }, |
… |
… |
|
192 | 195 | "fields": { |
193 | 196 | "age": 29, |
194 | 197 | "friends": [1], |
| 198 | "living": true, |
195 | 199 | "name": "James Bennett" |
196 | 200 | } |
197 | 201 | }, |
… |
… |
|
201 | 205 | "fields": { |
202 | 206 | "age": 37, |
203 | 207 | "friends": [6, 7], |
| 208 | "living": true, |
204 | 209 | "name": "Jeffrey Forcier" |
205 | 210 | } |
206 | 211 | }, |
… |
… |
|
210 | 215 | "fields": { |
211 | 216 | "age": 29, |
212 | 217 | "friends": [5, 7], |
| 218 | "living": true, |
213 | 219 | "name": "Paul Bissex" |
214 | 220 | } |
215 | 221 | }, |
… |
… |
|
219 | 225 | "fields": { |
220 | 226 | "age": 25, |
221 | 227 | "friends": [2, 5, 6], |
| 228 | "living": true, |
222 | 229 | "name": "Wesley J. Chun" |
223 | 230 | } |
224 | 231 | }, |
… |
… |
|
228 | 235 | "fields": { |
229 | 236 | "age": 57, |
230 | 237 | "friends": [9], |
| 238 | "living": true, |
231 | 239 | "name": "Peter Norvig" |
232 | 240 | } |
233 | 241 | }, |
… |
… |
|
237 | 245 | "fields": { |
238 | 246 | "age": 46, |
239 | 247 | "friends": [8], |
| 248 | "living": true, |
240 | 249 | "name": "Stuart Russell" |
241 | 250 | } |
242 | 251 | }, |
diff --git a/tests/regressiontests/aggregation_regress/models.py b/tests/regressiontests/aggregation_regress/models.py
index ccef9a5..66335d3 100644
a
|
b
|
class Author(models.Model):
|
6 | 6 | name = models.CharField(max_length=100) |
7 | 7 | age = models.IntegerField() |
8 | 8 | friends = models.ManyToManyField('self', blank=True) |
| 9 | living = models.BooleanField(default=True) |
9 | 10 | |
10 | 11 | def __unicode__(self): |
11 | 12 | return self.name |
diff --git a/tests/regressiontests/aggregation_regress/tests.py b/tests/regressiontests/aggregation_regress/tests.py
index 36a54c0..bec181e 100644
a
|
b
|
class AggregationTests(TestCase):
|
865 | 865 | ['Peter Norvig'], |
866 | 866 | lambda b: b.name |
867 | 867 | ) |
| 868 | |
| 869 | def test_sum_on_boolean(self): |
| 870 | qs = Author.objects.aggregate(Sum('living')) |
| 871 | self.assertEqual(qs, {'living__sum': 9}) |