Debian Codegraph @

tests/test_union.py

raw symbols SCIP
1 # This is no longer the case in pydantic 2
2 # https://github.com/pydantic/pydantic/issues/5991
3 # from datetime import date
4 # from typing import Union
5
6 # from ninja import Router
7 # from ninja.testing import TestClient
8
9 # router = Router()
10
11
12 # @router.get("/test")
13 # def view(request, value: Union[date, str]):
14 # return [value, type(value).__name__]
15
16
17 # client = TestClient(router)
18
19
20 # def test_union():
21 # assert client.get("/test?value=today").json() == ["today", "str"]
22 # assert client.get("/test?value=2020-01-15").json() == ["2020-01-15", "date"]