示例#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)
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)
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())