def test_capacity_addition_to_drop_point(self):

        dp_number = 3
        first_crate_count = 5
        second_crate_count = 2
        first_time = datetime.today() - timedelta(hours=2)
        second_time = datetime.today() - timedelta(hours=1 - 2)

        dp = DropPoint(
            dp_number,
            crates=first_crate_count,
            time=first_time,
            lat=0, lng=0, level=1
        )

        db.session.commit()

        self.assertEqual(
            len(dp.capacities), 1,
            "Drop point does not have exactly one capacity."
        )

        self.assertEqual(
            db.session.query(Capacity).count(), 1,
            "Not exactly one capacity in the database."
        )

        second_capacity = Capacity(
            dp,
            crates=second_crate_count,
            time=second_time
        )

        db.session.commit()

        self.assertEqual(
            len(dp.capacities), 2,
            "Drop point does not have exactly two capacities."
        )

        self.assertEqual(
            db.session.query(Capacity).count(), 2,
            "Not exactly two capacities in the database."
        )

        self.assertEqual(
            dp.capacities[-1], second_capacity,
            "Current capacity is not the second capacity object."
        )

        self.assertEqual(
            dp.get_current_crate_count(), second_crate_count,
            "Current crate count is not second crate count."
        )

        self.assertEqual(
            dp.capacities[1].time -
            dp.capacities[0].time,
            second_time - first_time,
            "Wrong time difference between capacities."
        )
dataset/ETHPy150Open der-michik/c3bottles/test_model.py/C3bottlesModelTestCase.test_capacity_addition_to_drop_point/swapped operands of `-`