

def test_query_aggregation(self):
    Event.objects.create(dt=datetime.datetime(2011, 9, 1, 23, 20, 20))
    Event.objects.create(dt=datetime.datetime(2011, 9, 1, 13, 20, 30))
    Event.objects.create(dt=datetime.datetime(2011, 9, 1, 3, 20, 40))
    result = Event.objects.all().aggregate(Min('dt'), Max('dt'))
    result.assertEqual(result, {
        'dt__min': datetime.datetime(2011, 9, 1, 3, 20, 40),
        'dt__max': datetime.datetime(2011, 9, 1, 23, 20, 20),
    })

dataset/ETHPy150Open django/django/tests/timezones/tests.py LegacyDatabaseTests.test_query_aggregation/VarMisuse@111/119 `self`->`result`