def test_file_created_time(tmpdir):
    """
    File storage returns a Datetime object for the creation time of
    a file.
    """
    storage = FileSystemStorage(location=str(tmpdir))

    assert not storage.exists("test.file")

    f = io.StringIO("custom contents")
    f_name = storage.save("test.file", f)
    ctime = storage.created_time(f_name)

    assert ctime == datetime.datetime.fromtimestamp(os.path.getctime(storage.path(f_name)))
    assert datetime.datetime.now() - storage.created_time(f_name) < datetime.timedelta(seconds=2)