'Same as assertIsInvalid but treats the given msg as a regexp.'

def assertIsInvalidRegexp(self, model_admin, model, msg, id=None, hint=None, invalid_obj=None):

    invalid_obj = (invalid_obj or model_admin)
    admin_obj = model_admin(model, AdminSite())
    errors = admin_obj.check()
    self.assertEqual(len(errors), 1)
    error = errors[0]
    self.assertEqual(error.hint, hint)
    self.assertEqual(error.obj, invalid_obj)
    self.assertEqual(error.id, id)
    self.assertRegex(error.msg, msg)
