def test_check_meal_session_exists_in_specified_time_method_returns_false(
            self):
        new_location = LocationFactory.create(name="Lagos")

        tz = pytz.timezone("Africa/Lagos")
        current_date = datetime.now(tz)

        first_meal_session = {
            "name":
            "lunch",
            "start_time":
            time(hour=12, minute=10),
            "end_time":
            time(hour=12, minute=40),
            "date_sent":
            datetime(year=current_date.year,
                     month=current_date.month,
                     day=current_date.day),
            "location_id":
            new_location.id
        }

        MealSessionFactory.create(name="lunch",
                                  start_time=time(hour=13, minute=0),
                                  stop_time=time(hour=14, minute=0),
                                  date=datetime(year=current_date.year,
                                                month=current_date.month,
                                                day=current_date.day),
                                  location_id=new_location.id)

        return_value = self.logic.check_meal_session_exists_in_specified_time(
            **first_meal_session)
        self.assertEqual(return_value, False)
    def test_new_meal_session_method_returns_new_meal_session_object(self):
        meal_session = MealSessionFactory.build()

        new_meal_session = self.repo.new_meal_session(
            name=meal_session.name,
            start_time=meal_session.start_time,
            stop_time=meal_session.stop_time,
            date=meal_session.date,
            location_id=meal_session.location_id)

        self.assertIsInstance(new_meal_session, MealSession)
        self.assertEqual(new_meal_session.location_id,
                         meal_session.location_id)
        self.assertEqual(new_meal_session.name, meal_session.name)
        self.assertEqual(new_meal_session.start_time, meal_session.start_time)
        self.assertEqual(new_meal_session.stop_time, meal_session.stop_time)