Skip to content

Commit

Permalink
fix(virginislands): Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
flooie committed Nov 21, 2023
1 parent 81cfdde commit 491b6a9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions juriscraper/opinions/united_states/territories/virginislands.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ def __init__(self, *args, **kwargs):
)
self.status = "Published"
today = date.today()
if self.test_mode_enabled():
self.last_month = datetime(2023, 9, 20).date()
else:
self.last_month = today - timedelta(days=60)
self.previous_date = today - timedelta(days=60)

def _process_html(self):
if self.test_mode_enabled():
self.previous_date = datetime(2023, 9, 21).date()

for s in self.html.xpath(".//tr/td/.."):
cells = s.xpath(".//td")
if not cells[0].text_content():
Expand All @@ -38,7 +38,7 @@ def _process_html(self):
date_object = convert_date_string(date)
docket = cells[2].text_content()
citation = cells[4].text_content()
if date_object < self.last_month:
if date_object < self.previous_date:
continue
u = s.xpath(".//td/a/@href")[0]
url = urllib.parse.quote(u, safe="/:")
Expand All @@ -52,3 +52,4 @@ def _process_html(self):
"url": url,
}
)
print(self.cases)

0 comments on commit 491b6a9

Please sign in to comment.