Skip to content

Commit c67f5ba

Browse files
committed
Add trivial model test to illustrate passing a datetime to the models
1 parent 8ba6da3 commit c67f5ba

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎tests/test_models.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1+
import datetime
12
import json
23
from datetime import timedelta
34
from pathlib import Path
45

56
import pytest
67

7-
from github_issues_import.models import IssueImportRequest, IssueImportStatusResponse
8+
from github_issues_import.models import Comment, IssueImportRequest, IssueImportStatusResponse
89

910
from .utils import get_fixture, get_fixtures
1011

1112

13+
def test_issue_comment():
14+
comment = Comment(body="Hello world!", created_at=datetime.datetime(2022, 1, 1, tzinfo=datetime.UTC))
15+
assert comment.body == "Hello world!"
16+
assert comment.created_at.year == 2022
17+
18+
1219
@pytest.mark.parametrize("fixture", get_fixtures("request-*.json"))
1320
def test_issue_import_request(fixture: Path):
1421
IssueImportRequest.model_validate_json(get_fixture(fixture))

0 commit comments

Comments
 (0)