Пример #1
0
    def setUp(self) -> None:
        docket = Docket(
            case_name="foo",
            court=Court.objects.get(pk="test"),
            source=Docket.DEFAULT,
        )
        docket.save()
        # Must be more than a year old for all tests to be runnable.
        last_month = now().date() - timedelta(days=400)
        self.doc_cluster = OpinionCluster(case_name="foo",
                                          docket=docket,
                                          date_filed=last_month)
        self.doc_cluster.save(index=False)
        opinion = Opinion(cluster=self.doc_cluster, type="Lead Opinion")
        opinion.save(index=False)

        opinion2 = Opinion(cluster=self.doc_cluster, type="Concurrence")
        opinion2.save(index=False)

        OpinionsCited.objects.create(citing_opinion=opinion2,
                                     cited_opinion=opinion)

        # Scrape the audio "site" and add its contents
        site = test_oral_arg_scraper.Site().parse()
        OralArgumentCommand().scrape_court(site, full_crawl=True)
Пример #2
0
    def test_ingest_oral_arguments(self):
        """Can we successfully ingest oral arguments at a high level?"""
        site = test_oral_arg_scraper.Site()
        site.method = "LOCAL"
        parsed_site = site.parse()
        cl_scrape_oral_arguments.Command().scrape_court(parsed_site,
                                                        full_crawl=True)

        # There should now be two items in the database.
        audio_files = Audio.objects.all()
        self.assertEqual(2, audio_files.count())
Пример #3
0
 def test_parsing_xml_oral_arg_site_to_site_object(self):
     """Does a basic parse of an oral arg site work?"""
     site = test_oral_arg_scraper.Site().parse()
     self.assertEqual(len(site.case_names), 2)