예제 #1
0
 def test_set_two_files(self):
     file_id_1 = "6bdfea4a01830fdd4a585181c0b8068c"
     file_id_2 = "e00699f859624e0f875ac6fe1e13d648"
     mark_local_files_as_available([file_id_1, file_id_2])
     self.assertEqual(LocalFile.objects.filter(available=True).count(), 2)
     self.assertTrue(LocalFile.objects.get(id=file_id_1).available)
     self.assertTrue(LocalFile.objects.get(id=file_id_2).available)
예제 #2
0
 def setUpTestData(cls):
     cls.upgraded_channel = ChannelBuilder()
     cls.upgraded_channel.insert_into_default_db()
     cls.upgraded_channel.move_resources(10)
     cls.set_content_fixture()
     mark_local_files_as_available(
         LocalFile.objects.all().values_list("id", flat=True),
         destination=cls.content_db_path,
     )
     ContentNode.objects.all().update(available=True)
     LocalFile.objects.all().update(available=True)
예제 #3
0
 def test_set_one_file(self):
     file_id = "6bdfea4a01830fdd4a585181c0b8068c"
     mark_local_files_as_available([file_id])
     self.assertEqual(LocalFile.objects.filter(available=True).count(), 1)
     self.assertTrue(LocalFile.objects.get(id=file_id).available)