def test_bool_and_general(self): values = AggregateTestModel.objects.aggregate( booland=BoolAnd('boolean_field')) self.assertEqual(values, {'booland': False})
def test_bool_and_empty_result(self): AggregateTestModel.objects.all().delete() values = AggregateTestModel.objects.aggregate( booland=BoolAnd('boolean_field')) self.assertEqual(values, {'booland': None})
def test_bool_and_q_object(self): values = AggregateTestModel.objects.aggregate(booland=BoolAnd( Q(integer_field__gt=2)), ) self.assertEqual(values, {'booland': False})