def METHOD_NAME(self):
    pages = test_item(self)
    static_directory = settings.STATICFILES_DIRS[0]
    url = getattr(self, "render_pages_url", self.url)
    # Remove the leading slash from the url to prevent that an absolute path is created
    directory = os.path.join(static_directory, "ts", "rendered", url[1:])
    os.makedirs(directory, exist_ok=True)
    for name, content in pages.items():
        with open(os.path.join(directory, f"{name}.html"), "wb") as html_file:
            html_file.write(content)