code: def test_report_post_schema_custom_width_validation(
      mocker: MockFixture,
  ) -> None:
      """
      Test the custom width validation.
      """
      current_app = mocker.patch("superset.reports.schemas.current_app")
      current_app.config = {
          "ALERT_REPORTS_MIN_CUSTOM_SCREENSHOT_WIDTH": 100,
          "ALERT_REPORTS_MAX_CUSTOM_SCREENSHOT_WIDTH": 200,
      }
  
      schema = ReportSchedulePostSchema()
  
      schema.load(
          {
              "type": "Report",
              "name": "A report",
              "description": "My report",
              "active": True,
              "crontab": "* * * * *",
              "timezone": "America/Los_Angeles",
              "custom_width": 100,
          }
      )
  
      # not required
      schema.load(
          {
              "type": "Report",
              "name": "A report",
              "description": "My report",
              "active": True,
              "crontab": "* * * * *",
              "timezone": "America/Los_Angeles",
          }
      )
  
      with pytest.raises(ValidationError) as excinfo:
          schema.load(
              {
                  "type": "Report",
                  "name": "A report",
                  "description": "My report",
                  "active": True,
                  "crontab": "* * * * *",
                  "timezone": "America/Los_Angeles",
                  "custom_width": 1000,
              }
          )
      assert excinfo.value.messages == {
          "custom_width": [
              "Screenshot width must be between 100px and 200px"
          ]
      }
  
imports: import pytest
  from marshmallow import ValidationError
  from pytest_mock import MockFixture
  from superset.reports.schemas import ReportSchedulePostSchema, ReportSchedulePutSchema
label_desc: Use image node_id 1 for calling a global function with example usage: test_report_post_schema_custom_width_validation(mocker) without return types