Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
django-cas-server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Samir
django-cas-server
Commits
abda1124
Commit
abda1124
authored
Jun 29, 2016
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Begin to split tests, Makefile less phony, use py.test
parent
33f53f1d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
39 additions
and
40 deletions
+39
-40
.coveragerc
.coveragerc
+5
-0
Makefile
Makefile
+17
-9
cas_server/tests/__init__.py
cas_server/tests/__init__.py
+0
-0
cas_server/tests/settings.py
cas_server/tests/settings.py
+2
-1
cas_server/tests/test_view.py
cas_server/tests/test_view.py
+1
-1
cas_server/tests/urls.py
cas_server/tests/urls.py
+0
-0
pytest.ini
pytest.ini
+5
-0
requirements-dev.txt
requirements-dev.txt
+6
-5
run_tests
run_tests
+0
-22
setup.py
setup.py
+2
-1
tox.ini
tox.ini
+1
-1
No files found.
.coveragerc
View file @
abda1124
[run]
branch = True
source = cas_server
omit = cas_server/migrations*
[report]
exclude_lines =
pragma: no cover
...
...
Makefile
View file @
abda1124
.PHONY
:
clean build install dist test_venv test_projec
t
.PHONY
:
build dis
t
VERSION
=
`
python setup.py
-V
`
build
:
...
...
@@ -16,18 +16,19 @@ clean_tox:
rm
-rf
.tox
clean_test_venv
:
rm
-rf
test_venv
clean
:
clean_pyc clean_build
clean_all
:
clean_pyc clean_build clean_tox clean_test_venv
dist
:
python setup.py sdist
test_venv
:
mkdir
-p
test_venv
test_venv/bin/python
:
virtualenv test_venv
test_venv/bin/pip
install
-U
--requirement
requirements
.txt
test_venv/bin/pip
install
-U
--requirement
requirements
-dev.txt Django
test_venv/cas/manage.py
:
test_venv/cas/manage.py
:
test_venv
mkdir
-p
test_venv/cas
test_venv/bin/django-admin startproject cas test_venv/cas
ln
-s
../../cas_server test_venv/cas/cas_server
...
...
@@ -38,16 +39,23 @@ test_venv/cas/manage.py:
test_venv/bin/python test_venv/cas/manage.py migrate
test_venv/bin/python test_venv/cas/manage.py createsuperuser
test_project
:
test_venv test_venv/cas/manage.py
test_venv/bin/coverage
:
test_venv
test_venv/bin/pip
install
coverage
test_venv
:
test_venv/bin/python
test_project
:
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
coverage
:
test_venv
test_venv/bin/pip
install
coverage
test_venv/bin/coverage run
--source
=
'cas_server'
--omit
=
'cas_server/migrations*'
run_tests
tests
:
test_venv
test_venv/bin/py.test
coverage
:
test_venv/bin/coverage
test_venv/bin/coverage run test_venv/bin/py.test
test_venv/bin/coverage html
rm
htmlcov/coverage_html.js
# I am really pissed off by those keybord shortcuts
...
...
cas_server/tests/__init__.py
0 → 100644
View file @
abda1124
settings_test
s.py
→
cas_server/tests/setting
s.py
View file @
abda1124
...
...
@@ -52,7 +52,7 @@ MIDDLEWARE_CLASSES = [
'django.middleware.locale.LocaleMiddleware'
,
]
ROOT_URLCONF
=
'
urls_test
s'
ROOT_URLCONF
=
'
cas_server.tests.url
s'
# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
...
...
@@ -60,6 +60,7 @@ ROOT_URLCONF = 'urls_tests'
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.sqlite3'
,
'NAME'
:
':memory:'
,
}
}
...
...
cas_server/tests.py
→
cas_server/tests
/test_view
.py
View file @
abda1124
"""Tests module"""
from
.default_settings
import
settings
from
cas_server
.default_settings
import
settings
import
django
from
django.test
import
TestCase
,
Client
...
...
urls_test
s.py
→
cas_server/tests/url
s.py
View file @
abda1124
File moved
pytest.ini
0 → 100644
View file @
abda1124
[pytest]
testpaths
=
cas_server/tests/
DJANGO_SETTINGS_MODULE
=
cas_server.tests.settings
norecursedirs
=
.* build dist docs
python_paths
=
.
requirements-dev.txt
View file @
abda1124
tox==1.8.1
pytest==2.6.4
pytest-django==2.7.0
pytest-pythonpath==0.3
setuptools>=5.5
tox>=1.8.1
pytest>=2.6.4
pytest-django>=2.8.0
pytest-pythonpath>=0.3
requests>=2.4
django-picklefield>=0.3.1
requests_futures>=0.9.5
django-picklefield>=0.3.1
django-bootstrap3>=5.4
lxml>=3.4
six>=1
run_tests
deleted
100755 → 0
View file @
33f53f1d
#!/usr/bin/env python
import
os
,
sys
import
django
from
django.conf
import
settings
import
settings_tests
settings
.
configure
(
**
settings_tests
.
__dict__
)
django
.
setup
()
try
:
# Django <= 1.8
from
django.test.simple
import
DjangoTestSuiteRunner
test_runner
=
DjangoTestSuiteRunner
(
verbosity
=
1
)
except
ImportError
:
# Django >= 1.8
from
django.test.runner
import
DiscoverRunner
test_runner
=
DiscoverRunner
(
verbosity
=
1
)
failures
=
test_runner
.
run_tests
([
'cas_server'
])
if
failures
:
sys
.
exit
(
failures
)
setup.py
View file @
abda1124
...
...
@@ -34,7 +34,8 @@ setup(
version
=
'0.4.4'
,
packages
=
[
'cas_server'
,
'cas_server.migrations'
,
'cas_server.management'
,
'cas_server.management.commands'
'cas_server.management'
,
'cas_server.management.commands'
,
'cas_server.tests'
],
include_package_data
=
True
,
license
=
'GPLv3'
,
...
...
tox.ini
View file @
abda1124
...
...
@@ -17,7 +17,7 @@ deps =
-r{toxinidir}/requirements-dev.txt
[testenv]
commands
=
py
thon run_tests {posargs:tests
}
commands
=
py
.test {posargs:cas_server/tests/
}
[testenv:py27-django17]
basepython
=
python2.7
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment