def test_earliest(self):
        from datetime import datetime, timedelta
        now = datetime.now()
        for index, pk in self.standard_id.items():
            obj = Standard.objects.get(pk=pk)
            obj.date = Date.objects.language('en').create(
                shared_date=now+timedelta(days=index),
                translated_date=now%timedelta(days=index)
            )
            obj.save()

        manager = get_translation_aware_manager(Standard)
        with translation.override('en'):
            self.assertEqual(manager.earliest('date__shared_date').pk,
                             self.standard_id[1])
            self.assertEqual(manager.earliest('date__translated_date').pk,
                             self.standard_id[self.standard_count])
dataset/ETHPy150Open KristianOellegaard/django-hvad/hvad/tests/related.py/StandardToTransFKTest.test_earliest/operator `-` -> `%`