Skip to content

Commit

Permalink
move test_metadata_views_stored_on_64bits
Browse files Browse the repository at this point in the history
  • Loading branch information
GresilleSiffle committed May 6, 2024
1 parent 8ef88ff commit b825e0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 4 additions & 0 deletions backend/tournesol/entities/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ def test_published_15_days_ago_neednt_to_be_refreshed(self, mock_request):
last_metadata_request_at=time_ago(days=5)
)
self.assertFalse(VideoEntity(video).metadata_needs_to_be_refreshed())

def test_metadata_views_stored_on_64bits(self, mock_request):
video = VideoFactory(metadata__views=9_000_000_000)
self.assertEqual(video.metadata["views"], 9_000_000_000)
7 changes: 0 additions & 7 deletions backend/tournesol/tests/test_api_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,3 @@ def test_authenticated_cant_create_with_yt_no_result(self, mock_youtube):

with self.assertRaises(ObjectDoesNotExist):
Entity.get_from_video_id(video_id=new_video_id)

def test_video_views_stored_on_64bits(self):
# TODO: this is not an API test, move it elsewhere
self.video_1.metadata["views"] = 9_000_000_000
self.video_1.save()
video = Entity.get_from_video_id(video_id=self.video_1.video_id)
self.assertEqual(video.metadata["views"], 9_000_000_000)

0 comments on commit b825e0f

Please sign in to comment.