@pytest.mark.django_db
@freeze_time(datetime.datetime.now())
def test_create_board(client, board, test_user):
client.force_login(test_user)
time = DateTimeField().to_representation
expected_response = {
"id": board.pk + 1,
"created": time(board.created),
"update": time(board.update),
"title": "test_board",
"is_deleted": False
}
data = {
'title': 'test_board'
}
response = client.post("/goals/board/create", data=data)
assert response.status_code == 201
assert response.json() == expected_response
Выйдет километровую ошибку и в конце написано
from pydantic import BaseModel, Field
pydantic\__init__.py:2: in init pydantic.__init__
???
pydantic\dataclasses.py:43: in init pydantic.dataclasses
???
pydantic\error_wrappers.py:4: in init pydantic.error_wrappers
???
pydantic\json.py:14: in init pydantic.json
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E ImportError: cannot import name errors