def test_delete_meal_when_meal_doesnot_exist(
        self,
        mock_get
    ):
        '''Test delete_meal when meal item doesnot exist.
        '''
        with self.app.app_context():
            mock_get.return_value = None
            meal_item_controller = MealItemController(self.request_context)

            # Act
            result = meal_item_controller.delete_meal(1)

            # Assert
            assert result.status_code == 400
            assert result.get_json()['msg'] == 'Invalid or incorrect meal_id' \
                ' provided'
    def test_delete_meal_when_meal_is_already_deleted(
        self,
        mock_get
    ):
        '''Test delete_meal when the meal is already deleted.
        '''
        # Arrange
        with self.app.app_context():
            mock_get.return_value = self.mock_deleted_meal_item
            meal_item_controller = MealItemController(self.request_context)

            # Act
            result = meal_item_controller.delete_meal(1)

            # Assert
            assert result.status_code == 400
            assert result.get_json()['msg'] == 'Bad Request. This meal item' \
                ' is deleted'
    def test_delete_meal_ok_response(
        self,
        mock_update,
        mock_get
    ):
        '''Test delete_meal OK response.
        '''
        # Arrange
        with self.app.app_context():
            mock_get.return_value = self.mock_meal_item
            mock_update.return_value = self.mock_meal_item
            meal_item_controller = MealItemController(self.request_context)

            # Act
            result = meal_item_controller.delete_meal(1)

            # Assert
            assert result.status_code == 200
            assert result.get_json()['msg'] == 'OK'