@classmethod
    def setUpTestData(cls):
        cls.sday = sday = datetime.date(2010, 6, 25)
        cls.stime = stime = datetime.datetime(2010, 6, 25, 12, 15, 30, 747000)
        midnight = datetime.time(0)

        delta0 = datetime.timedelta(0)
        delta1 = datetime.timedelta(microseconds=253000)
        delta2 = datetime.timedelta(seconds=44)
        delta3 = datetime.timedelta(hours=21, minutes=8)
        delta4 = datetime.timedelta(days=10)

        # Test data is set so that deltas and delays will be
        # strictly increasing.
        cls.deltas = []
        cls.delays = []
        cls.days_long = []

        # e0: started same day as assigned, zero duration
        end = stime + delta0
        e0 = Experiment.objects.create(
            name='e0', assigned=sday, start=stime, end=end,
            completed=end.date(), estimated_time=delta0,
        )
        cls.deltas.append(delta0)
        cls.delays.append(e0.start - datetime.datetime.combine(e0.assigned, midnight))
        cls.days_long.append(e0.assigned - e0.completed)

        # e1: started one day after assigned, tiny duration, data
        # set so that end time has no fractional seconds, which
        # tests an edge case on sqlite. This Experiment is only
        # included in the test data when the DB supports microsecond
        # precision.
        if connection.features.supports_microsecond_precision:
            delay = datetime.timedelta(1)
            end = stime + delay + delta1
            e1 = Experiment.objects.create(
                name='e1', assigned=sday, start=stime + delay, end=end,
                completed=end.date(), estimated_time=delta1,
            )
            cls.deltas.append(delta1)
            cls.delays.append(e1.start - datetime.datetime.combine(e1.assigned, midnight))
            cls.days_long.append(e1.completed - e1.assigned)

        # e2: started three days after assigned, small duration
        end = stime + delta2
        e2 = Experiment.objects.create(
            name='e2', assigned=sday - datetime.timedelta(3), start=stime,
            end=end, completed=end.date(), estimated_time=datetime.timedelta(hours=1),
        )
        cls.deltas.append(delta2)
        cls.delays.append(e2.start - datetime.datetime.combine(e2.assigned, midnight))
        cls.days_long.append(e2.completed - e2.assigned)

        # e3: started four days after assigned, medium duration
        delay = datetime.timedelta(4)
        end = stime + delay + delta3
        e3 = Experiment.objects.create(
            name='e3', assigned=sday, start=stime + delay, end=end,
            completed=end.date(), estimated_time=delta3,
        )
        cls.deltas.append(delta3)
        cls.delays.append(e3.start - datetime.datetime.combine(e3.assigned, midnight))
        cls.days_long.append(e3.completed - e3.assigned)

        # e4: started 10 days after assignment, long duration
        end = stime + delta4
        e4 = Experiment.objects.create(
            name='e4', assigned=sday - datetime.timedelta(10), start=stime,
            end=end, completed=end.date(), estimated_time=delta4 - datetime.timedelta(1),
        )
        cls.deltas.append(delta4)
        cls.delays.append(e4.start - datetime.datetime.combine(e4.assigned, midnight))
        cls.days_long.append(e4.completed - e4.assigned)
        cls.expnames = [e.name for e in Experiment.objects.all()]
dataset/ETHPy150Open django/django/tests/expressions/tests.py/FTimeDeltaTests.setUpTestData/swapped operands of `-`