Beispiel #1
0
def test_rss_packages(db_request):
    db_request.find_service = pretend.call_recorder(
        lambda *args, **kwargs: pretend.stub(
            enabled=False,
            csp_policy=pretend.stub(),
            merge=lambda _: None,
        ))

    db_request.session = pretend.stub()

    project1 = ProjectFactory.create()
    project1.created = datetime.date(2011, 1, 1)
    ReleaseFactory.create(project=project1)

    project2 = ProjectFactory.create()
    project2.created = datetime.date(2012, 1, 1)

    project3 = ProjectFactory.create()
    project3.created = datetime.date(2013, 1, 1)
    ReleaseFactory.create(project=project3)

    assert rss.rss_packages(db_request) == {
        "newest_projects": [project3, project1],
    }
    assert db_request.response.content_type == "text/xml"
Beispiel #2
0
def test_rss_packages(db_request):
    db_request.find_service = pretend.call_recorder(
        lambda *args, **kwargs: pretend.stub(
            enabled=False,
            csp_policy=pretend.stub(),
            merge=lambda _: None,
        )
    )

    db_request.session = pretend.stub()

    project1 = ProjectFactory.create()
    project1.created = datetime.date(2011, 1, 1)
    ReleaseFactory.create(project=project1)

    project2 = ProjectFactory.create()
    project2.created = datetime.date(2012, 1, 1)

    project3 = ProjectFactory.create()
    project3.created = datetime.date(2013, 1, 1)
    ReleaseFactory.create(project=project3)

    assert rss.rss_packages(db_request) == {
        "newest_projects": [project3, project1],
    }
    assert db_request.response.content_type == "text/xml"
Beispiel #3
0
def test_rss_packages(db_request):
    project1 = ProjectFactory.create()
    project1.created = datetime.date(2011, 1, 1)
    ReleaseFactory.create(project=project1)

    project2 = ProjectFactory.create()
    project2.created = datetime.date(2012, 1, 1)

    project3 = ProjectFactory.create()
    project3.created = datetime.date(2013, 1, 1)
    ReleaseFactory.create(project=project3)

    assert rss.rss_packages(db_request) == {
        "newest_projects": [project3, project1],
    }
    assert db_request.response.content_type == "text/xml"