cheesy/moku/tests/test_post.py

17 lines
488 B
Python
Raw Permalink Normal View History

2024-03-26 13:50:37 +00:00
import re
import pytest
from moku.models.post import Post
@pytest.mark.django_db
def test_post(post: Post, re_uuid: re.Pattern):
"""Test that a post is created successfully with all required data."""
assert isinstance(post.pk, int)
assert post.pk > 0
assert post.pk == post.id
assert re_uuid.match(post.uuid) is not None
2024-03-27 16:19:10 +00:00
assert post.html == '<a href="/user/jean">@jean</a> cooked sausage surprise'
assert post.plain_text == "@jean cooked sausage surprise"