code: def test_decimal():
      class Model(SQLModel):
          dec: Decimal = Field(max_digits=4, decimal_places=2)
  
      Model(dec=Decimal("3.14"))
      Model(dec=Decimal("69.42"))
  
      with pytest.raises(ValidationError):
          Model(dec=Decimal("3.142"))
      with pytest.raises(ValidationError):
          Model(dec=Decimal("0.069"))
      with pytest.raises(ValidationError):
          Model(dec=Decimal("420"))
  
file_path: sqlmodel/tests/test_pydantic/test_field.py
imports: from decimal import Decimal
  from typing import Optional, Union
  import pytest
  from pydantic import ValidationError
  from sqlmodel import Field, SQLModel
  from typing_extensions import Literal
label_desc: Use image node_id 1 for calling a global function with example usage: test_decimal() without return types