Commit 155a9192 authored by Valentin Samir's avatar Valentin Samir

Update Makefile to setup more easily the test env

parent 3a57ad08
.PHONY: clean build install dist test_venv .PHONY: clean build install dist test_venv test_project
VERSION=`python setup.py -V` VERSION=`python setup.py -V`
build: build:
...@@ -22,14 +22,15 @@ clean_all: clean_pyc clean_build clean_tox clean_test_venv ...@@ -22,14 +22,15 @@ clean_all: clean_pyc clean_build clean_tox clean_test_venv
dist: dist:
python setup.py sdist python setup.py sdist
test_venv: dist test_venv:
mkdir -p test_venv mkdir -p test_venv
virtualenv test_venv virtualenv test_venv
test_venv/bin/pip install -U django-cas-server -f ./dist/django-cas-server-${VERSION}.tar.gz test_venv/bin/pip install -U --requirement requirements.txt
test_venv/cas: test_venv/cas/manage.py:
mkdir -p test_venv/cas mkdir -p test_venv/cas
test_venv/bin/django-admin startproject cas test_venv/cas test_venv/bin/django-admin startproject cas test_venv/cas
ln -s ../../cas_server test_venv/cas/cas_server
sed -i "s/'django.contrib.staticfiles',/'django.contrib.staticfiles',\n 'bootstrap3',\n 'cas_server',/" test_venv/cas/cas/settings.py sed -i "s/'django.contrib.staticfiles',/'django.contrib.staticfiles',\n 'bootstrap3',\n 'cas_server',/" test_venv/cas/cas/settings.py
sed -i "s/'django.middleware.clickjacking.XFrameOptionsMiddleware',/'django.middleware.clickjacking.XFrameOptionsMiddleware',\n 'django.middleware.locale.LocaleMiddleware',/" test_venv/cas/cas/settings.py sed -i "s/'django.middleware.clickjacking.XFrameOptionsMiddleware',/'django.middleware.clickjacking.XFrameOptionsMiddleware',\n 'django.middleware.locale.LocaleMiddleware',/" test_venv/cas/cas/settings.py
sed -i 's/from django.conf.urls import url/from django.conf.urls import url, include/' test_venv/cas/cas/urls.py sed -i 's/from django.conf.urls import url/from django.conf.urls import url, include/' test_venv/cas/cas/urls.py
...@@ -37,5 +38,9 @@ test_venv/cas: ...@@ -37,5 +38,9 @@ test_venv/cas:
test_venv/bin/python test_venv/cas/manage.py migrate test_venv/bin/python test_venv/cas/manage.py migrate
test_venv/bin/python test_venv/cas/manage.py createsuperuser test_venv/bin/python test_venv/cas/manage.py createsuperuser
run_test_server: test_venv test_venv/cas test_project: test_venv test_venv/cas/manage.py
@echo "##############################################################"
@echo "A test django project was created in $(realpath test_venv/cas)"
run_test_server: test_project
test_venv/bin/python test_venv/cas/manage.py runserver test_venv/bin/python test_venv/cas/manage.py runserver
Django >= 1.8,<1.10
tox==1.8.1 tox==1.8.1
pytest==2.6.4 pytest==2.6.4
pytest-django==2.7.0 pytest-django==2.7.0
......
Markdown is supported
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