Beispiel #1
0
 def test_modified_time(self):
     with self.save_file():
         modified_time = default_storage.modified_time("test.txt")
         logging.info("modified time: %s", modified_time)
         self.assertTrue(is_naive(modified_time))
         self.assertLess(abs(modified_time - make_naive(timezone.now(), utc)), timedelta(seconds=10))
         self.assertEqual(default_storage.accessed_time("test.txt"), modified_time)
         self.assertEqual(default_storage.created_time("test.txt"), modified_time)
Beispiel #2
0
 def testModifiedTime(self):
     with self.save_file():
         modified_time = default_storage.modified_time("foo.txt")
         # Check that the timestamps are roughly equals.
         self.assertLess(abs(modified_time - make_naive(timezone.now(), utc)), timedelta(seconds=10))
         # All other timestamps are slaved to modified time.
         self.assertEqual(default_storage.accessed_time("foo.txt"), modified_time)
         self.assertEqual(default_storage.created_time("foo.txt"), modified_time)