This repository has been archived on 2023-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
python-blog/articles/tests/test_admin.py

16 lines
435 B
Python
Raw Normal View History

2020-12-28 10:13:35 +01:00
import pytest
from django.test import Client
from django.urls import reverse
from articles.models import User
@pytest.mark.django_db
2021-03-03 17:31:31 +01:00
# @pytest.mark.skip("Fails for no apparent reason")
@pytest.mark.flaky(reruns=5, reruns_delay=3)
2020-12-28 10:13:35 +01:00
def test_can_access_add_article(client: Client, author: User):
client.force_login(author)
2021-03-03 17:31:31 +01:00
url = reverse("admin:articles_article_add")
res = client.get(url)
2020-12-28 10:13:35 +01:00
assert res.status_code == 200