From b825e0fce5971f7f51b889c734f109edba35023c Mon Sep 17 00:00:00 2001 From: Gresille&Siffle <39056254+GresilleSiffle@users.noreply.github.com> Date: Mon, 6 May 2024 15:34:31 +0200 Subject: [PATCH] move test_metadata_views_stored_on_64bits --- backend/tournesol/entities/test_video.py | 4 ++++ backend/tournesol/tests/test_api_video.py | 7 ------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/backend/tournesol/entities/test_video.py b/backend/tournesol/entities/test_video.py index 50b26cf095..d6a8f54809 100644 --- a/backend/tournesol/entities/test_video.py +++ b/backend/tournesol/entities/test_video.py @@ -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) diff --git a/backend/tournesol/tests/test_api_video.py b/backend/tournesol/tests/test_api_video.py index 37ac3ac36b..e119914801 100644 --- a/backend/tournesol/tests/test_api_video.py +++ b/backend/tournesol/tests/test_api_video.py @@ -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)