File: test_pydantic_config.py

package info (click to toggle)
python-beanie 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,480 kB
  • sloc: python: 14,427; makefile: 7; sh: 6
file content (10 lines) | stat: -rw-r--r-- 253 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
import pytest
from pydantic import ValidationError

from tests.odm.models import DocumentWithPydanticConfig


def test_pydantic_config():
    doc = DocumentWithPydanticConfig(num_1=2)
    with pytest.raises(ValidationError):
        doc.num_1 = "wrong"