From 75c4be490ad290cfa1d057dc1d9609736cda694b Mon Sep 17 00:00:00 2001 From: yu23ki14 Date: Sun, 18 Aug 2024 11:02:33 +0900 Subject: [PATCH] fix post link --- common/birdxplorer_common/models.py | 2 +- common/tests/conftest.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/birdxplorer_common/models.py b/common/birdxplorer_common/models.py index 5b74fdd..72052dd 100644 --- a/common/birdxplorer_common/models.py +++ b/common/birdxplorer_common/models.py @@ -678,8 +678,8 @@ class XUser(BaseModel): class Post(BaseModel): - link: HttpUrl post_id: PostId + link: Optional[HttpUrl] = None x_user_id: UserId x_user: XUser text: str diff --git a/common/tests/conftest.py b/common/tests/conftest.py index 5af7934..a8c048b 100644 --- a/common/tests/conftest.py +++ b/common/tests/conftest.py @@ -205,6 +205,7 @@ def post_samples(post_factory: PostFactory, x_user_samples: List[XUser]) -> Gene posts = [ post_factory.build( post_id="2234567890123456781", + link=None, x_user_id="1234567890123456781", x_user=x_user_samples[0], text="""\ @@ -219,6 +220,7 @@ def post_samples(post_factory: PostFactory, x_user_samples: List[XUser]) -> Gene ), post_factory.build( post_id="2234567890123456791", + link=None, x_user_id="1234567890123456781", x_user=x_user_samples[0], text="""\ @@ -233,6 +235,7 @@ def post_samples(post_factory: PostFactory, x_user_samples: List[XUser]) -> Gene ), post_factory.build( post_id="2234567890123456801", + link=None, x_user_id="1234567890123456782", x_user=x_user_samples[1], text="""\