          self.assertEqual(obj.empty.name, "django_test.txt")
          self.assertEqual(obj.empty.read(), b"more content")
          obj.empty.close()
  
      def test_random_upload_to(self):
          # Verify the fix for #5655, making sure the directory is only
          # determined once.
          obj = Storage()
          obj.random.save("random_file", ContentFile("random content"))
 
</s>
    def test_pathlib_upload_to(self):
        obj = Storage()
        obj.pathlib_callable.save('some_file1.txt', ContentFile('some content'))
        self.assertEqual(obj.pathlib_callable.name, 'bar/some_file1.txt')
        obj.random.close()

          self.assertEqual(obj.empty.name, "django_test.txt")
          self.assertEqual(obj.empty.read(), b"more content")
          obj.empty.close()
  
    def test_pathlib_upload_to(self):
        obj = Storage()
        obj.pathlib_callable.save('some_file1.txt', ContentFile('some content'))
        self.assertEqual(obj.pathlib_callable.name, 'bar/some_file1.txt')
        obj.random.close()

      def test_random_upload_to(self):
          # Verify the fix for #5655, making sure the directory is only
          # determined once.
          obj = Storage()
          obj.random.save("random_file", ContentFile("random content"))
keep keep keep add keep keep keep keep keep
 Refs #28428 -- Added test for a callable FileField.upload_to that returns pathlib.Path.
tests/file_storage/tests.py