Skip to content

Commit

Permalink
Update test with new working new_year calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
pampletousse committed Aug 28, 2023
1 parent 38df73e commit aba9dab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pod/video/tests/test_obsolescence.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,15 @@ def test_check_video_date_delete(self):
self.assertEqual(video.date_delete, date1)

video2 = Video.objects.get(id=2)
affiliation_years = [
settings.ACCOMMODATION_YEARS.get(key)
for key in video2.owner.owner.affiliation
if key in settings.ACCOMMODATION_YEARS
]
new_year = max(affiliation_years) if len(affiliation_years) else DEFAULT_YEAR_DATE_DELETE
date2 = date(
date.today().year
+ settings.ACCOMMODATION_YEARS[video2.owner.owner.affiliation],
+ new_year,
date.today().month,
date.today().day,
)
Expand Down

0 comments on commit aba9dab

Please sign in to comment.