def test_create_passes(self):

        slot_s = sn_misc.get_next_midnight()
        slot_e = slot_s + py_timedelta(days=1)

        self.assertIsNotNone(
            pass_models.PassSlots.objects.create(
                spacecraft=self.__sc_1, groundstation=self.__gs_1,
                start=slot_s, end=slot_e
            )
        )
        self.assertIsNone(
            pass_models.PassSlots.objects.create(
                spacecraft=self.__sc_1, groundstation=self.__gs_1,
                start=slot_s, end=slot_e
            )
        )

        slot_s = slot_s + py_timedelta(days=1)
        slot_e = slot_s + py_timedelta(days=1)

        self.assertIsNotNone(
            pass_models.PassSlots.objects.create(
                spacecraft=self.__sc_1, groundstation=self.__gs_1,
                start=slot_s, end=slot_e
            )
        )
        self.assertIsNone(
            pass_models.PassSlots.objects.create(
                spacecraft=self.__sc_1, groundstation=self.__gs_1,
                start=slot_s, end=slot_e
            )
        )
UNIT test: services.simulation.models.passes
dataset/ETHPy150Open satnet-project/server/services/simulation/tests/models/test_passes.py/TestModels.test_create_passes