Skip to content

Commit

Permalink
Separate some of the schemas to make sure tests are run
Browse files Browse the repository at this point in the history
  • Loading branch information
surenkov committed May 5, 2024
1 parent bcbe714 commit a516110
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
26 changes: 26 additions & 0 deletions tests/v1/schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import typing as t
from datetime import date

try:
import pydantic.v1 as pydantic
except ImportError:
import pydantic

from pydantic.dataclasses import dataclass


class InnerSchema(pydantic.BaseModel):
stub_str: str
stub_int: int = 1
stub_list: t.List[date]

class Config:
allow_mutation = True
frozen = False


@dataclass
class SampleDataclass:
stub_str: str
stub_list: t.List[date]
stub_int: int = 1
2 changes: 1 addition & 1 deletion tests/v1/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import pytest

from tests.conftest import InnerSchema, SampleDataclass
from .schema import InnerSchema, SampleDataclass

base = pytest.importorskip("django_pydantic_field.v1.base")

Expand Down
2 changes: 1 addition & 1 deletion tests/v1/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.core.exceptions import ValidationError
from django.forms import Form, modelform_factory

from tests.conftest import InnerSchema
from .schema import InnerSchema
from tests.test_app.models import SampleForwardRefModel, SampleSchema

fields = pytest.importorskip("django_pydantic_field.v1.fields")
Expand Down
2 changes: 1 addition & 1 deletion tests/v1/test_rest_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from rest_framework.decorators import api_view, parser_classes, renderer_classes, schema
from rest_framework.response import Response

from tests.conftest import InnerSchema
from .schema import InnerSchema
from tests.test_app.models import SampleModel

rest_framework = pytest.importorskip("django_pydantic_field.v1.rest_framework")
Expand Down

0 comments on commit a516110

Please sign in to comment.