'Raise NotImplementedError when aggregating on date/time fields (#19360).'

def test_aggregation(self):

    for aggregate in (Sum, Avg, Variance, StdDev):
        with self.assertRaises(NotImplementedError):
            Item.objects.all().aggregate(aggregate('time'))
        with self.assertRaises(NotImplementedError):
            Item.objects.all().aggregate(aggregate('date'))
        with self.assertRaises(NotImplementedError):
            Item.objects.all().aggregate(aggregate('last_modified'))
        with self.assertRaises(NotImplementedError):
            Item.objects.all().aggregate(**{'complex': (aggregate('last_modified') + aggregate('last_modified'))})
