예제 #1
0
 def test_cron_all_stale(self):
     old = time.time() - settings.WATERMARK_CLEANUP_SECONDS - 1000
     for path in os.listdir(self.folder):
         os.utime(os.path.join(self.folder, path), (old, old))
     cleanup_watermarked_file()
     assert not os.path.exists(self.folder)
예제 #2
0
 def test_cron_one_stale(self):
     path = os.path.join(self.folder, os.listdir(self.folder)[0])
     old = time.time() - settings.WATERMARK_CLEANUP_SECONDS - 1000
     os.utime(path, (old, old))
     cleanup_watermarked_file()
     eq_(len(os.listdir(self.folder)), UserProfile.objects.count() - 1)
예제 #3
0
 def test_cron_fresh(self):
     cleanup_watermarked_file()
     eq_(len(os.listdir(self.folder)), UserProfile.objects.count())
예제 #4
0
 def test_cron_all_stale(self):
     old = time.time() - settings.WATERMARK_CLEANUP_SECONDS - 1000
     for path in os.listdir(self.folder):
         os.utime(os.path.join(self.folder, path), (old, old))
     cleanup_watermarked_file()
     assert not os.path.exists(self.folder)
예제 #5
0
 def test_cron_one_stale(self):
     path = os.path.join(self.folder, os.listdir(self.folder)[0])
     old = time.time() - settings.WATERMARK_CLEANUP_SECONDS - 1000
     os.utime(path, (old, old))
     cleanup_watermarked_file()
     eq_(len(os.listdir(self.folder)), UserProfile.objects.count() - 1)
예제 #6
0
 def test_cron_fresh(self):
     cleanup_watermarked_file()
     eq_(len(os.listdir(self.folder)), UserProfile.objects.count())