def test_file_modified_time(tmpdir):
    """
    File storage returns a Datetime object for the last modified 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)
    mtime = storage.modified_time(f_name)

    assert mtime == datetime.datetime.fromtimestamp(os.path.getmtime(storage.path(f_name)))
    assert datetime.datetime.now() - storage.modified_time(f_name) < datetime.timedelta(seconds=2)