Commit e832a93b authored by Valentin Samir's avatar Valentin Samir
Browse files

Add a run_test_server target to make file

running make run_test_server will build a virtualenv, create a django projet
with django-cas-server and lauch ./ runserver
parent 7b4fac57
......@@ -9,3 +9,4 @@ db.sqlite3
.PHONY: clean build install dist
.PHONY: clean build install dist test_venv
python build
......@@ -10,5 +12,27 @@ clean:
find ./ -name __pycache__ -delete
rm -rf build django_cas_server.egg-info dist
clean_all: clean
rm -rf test_venv .tox
python sdist
test_venv: dist
mkdir -p test_venv
virtualenv test_venv
test_venv/bin/pip install -U django-cas-server ./dist/django-cas-server-${VERSION}.tar.gz
mkdir -p test_venv/cas
test_venv/bin/django-admin startproject cas test_venv/cas
sed -i "s/'django.contrib.staticfiles',/'django.contrib.staticfiles',\n 'bootstrap3',\n 'cas_server',/" test_venv/cas/cas/
sed -i "s/'django.middleware.clickjacking.XFrameOptionsMiddleware',/'django.middleware.clickjacking.XFrameOptionsMiddleware',\n 'django.middleware.locale.LocaleMiddleware',/" test_venv/cas/cas/
sed -i 's/from django.conf.urls import url/from django.conf.urls import url, include/' test_venv/cas/cas/
sed -i "s@url(r'^admin/',,@url(r'^admin/',,\n url(r'^', include('cas_server.urls', namespace='cas_server')),@" test_venv/cas/cas/
test_venv/cas/ migrate
test_venv/cas/ createsuperuser
run_test_server: test_venv test_venv/cas
test_venv/cas/ runserver
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment