Пример #1
0
def test_get(client, url, author, articles):
    response = client.get(url)
    articles = response.context["object_list"]
    topics = response.context["topics"]
    assert is_paginated(response)
    assert is_ordered(response)
    assert only_published_articles(articles, timezone.now())
    assert only_topics_for_articles(articles, topics)
Пример #2
0
def test_get(client, url, articles):
    response = client.get(url)
    articles = response.context["object_list"]
    topics = response.context["topics"]
    notifications = response.context["notifications"]
    end_date = dt.date.today()
    start_date = end_date - dt.timedelta(days=6)
    assert is_paginated(response)
    assert is_ordered(response)
    assert only_published_articles(articles, timezone.now())
    assert only_topics_for_articles(articles, topics)
    assert only_articles_between_dates(articles, start_date, end_date)
    assert only_published_notifications(notifications, timezone.now())
Пример #3
0
def test_get(client, url, sources):
    response = client.get(url)
    assert is_paginated(response)
    assert is_ordered(response)
Пример #4
0
def test_get(client, url, updates):
    response = client.get(url)
    updates = response.context["object_list"]
    assert is_paginated(response)
    assert is_ordered(updates)
    assert all_updates_published(updates, timezone.now())
Пример #5
0
def test_get(client, url, articles):
    response = client.get(url)
    articles = response.context["objects"]
    assert is_ordered(response, key="objects")
    assert only_published_articles(articles, timezone.now())