コード例 #1
0
    def test_status_and_content_type(self, rf):
        project = factories.ProjectFactory()
        request = rf.get("/")
        response = views.surt_report(request, project.project_slug)

        assert response.status_code == 200
        assert response["Content-Type"] == 'text/plain; charset="UTF-8"'
コード例 #2
0
    def test_report_text(self, rf):
        project = factories.ProjectFactory()
        urls = factories.URLFactory.create_batch(3, url_project=project, attribute="surt")
        request = rf.get("/")
        response = views.surt_report(request, project.project_slug)

        assert "#This list of SURTs" in response.content
        for url in urls:
            assert url.value in response.content