Add Docker-executed pytest suite with >90% coverage
This commit is contained in:
0
apps/authors/tests/__init__.py
Normal file
0
apps/authors/tests/__init__.py
Normal file
16
apps/authors/tests/test_models.py
Normal file
16
apps/authors/tests/test_models.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import pytest
|
||||
|
||||
from apps.authors.models import Author
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_author_create_and_social_links():
|
||||
author = Author.objects.create(name="Mark", slug="mark", twitter_url="https://x.com/mark")
|
||||
assert str(author) == "Mark"
|
||||
assert author.get_social_links() == {"twitter": "https://x.com/mark"}
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_author_user_nullable():
|
||||
author = Author.objects.create(name="No User", slug="no-user")
|
||||
assert author.user is None
|
||||
Reference in New Issue
Block a user