clone cms with menus, make menus standalone app

This commit is contained in:
bruks 2026-09-30 15:27:04 +01:00
commit afb096b7a3
1153 changed files with 318897 additions and 37 deletions

26
cms/test_utils/tmpdir.py Normal file
View file

@ -0,0 +1,26 @@
import os
import random
import shutil
import stat
from contextlib import contextmanager
from tempfile import mkdtemp
@contextmanager
def temp_dir():
name = make_temp_dir()
yield name
shutil.rmtree(name)
def make_temp_dir():
if os.path.exists('/dev/shm/'):
if os.stat('/dev/shm').st_mode & stat.S_IWGRP:
dirname = 'django-cms-tests-%s' % random.randint(1, 1000000)
path = os.path.join('/dev/shm', dirname)
while os.path.exists(path):
dirname = 'django-cms-tests-%s' % random.randint(1, 1000000)
path = os.path.join('/dev/shm', dirname)
os.mkdir(path)
return path
return mkdtemp()