def METHOD_NAME(self):
    file = SimpleUploadedFile("pixel.png", PIXEL_GIF, content_type="image/png")
    validator = validators.MimeTypeValidator()
    with self.assertRaisesMessage(
        ValidationError, "The provided file is not a .png."
    ):
        validator(file)