This commit is contained in:
Gabriel Augendre 2020-08-18 08:36:55 +02:00
parent 546f8b4078
commit dd7b24018b

View file

@ -33,3 +33,12 @@ def test_abstract_shown_on_list(client: Client, author: User):
content = res.content.decode("utf-8") content = res.content.decode("utf-8")
assert abstract in content assert abstract in content
assert after not in content assert after not in content
@pytest.mark.django_db
def test_access_article_by_slug(client: Client, published_article: Article):
res = client.get(reverse("article-detail", kwargs={"slug": published_article.slug}))
assert res.status_code == 200
content = res.content.decode("utf-8")
assert published_article.title in content
assert published_article.get_formatted_content() in content