def METHOD_NAME(self):
    test_datetime = datetime.datetime(1975, 2, 13)
    obj = HasDateTraits()
    with self.assertRaises(TraitError) as exception_context:
        obj.datetime_prohibited = test_datetime
    message = str(exception_context.exception)
    self.assertIn("must be a non-datetime date, but", message)