Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a way to run tests and two dummy tests
Added login-logic to sso_server
- Loading branch information
Jonas Obrist
committed
Aug 10, 2011
1 parent
ffcf72f
commit a318015
Showing
9 changed files
with
124 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
*.pyc | ||
.* | ||
/build/ | ||
/dist/ | ||
*.egg-info | ||
/*env*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Copyright (c) 2011, Jonas Obrist | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
* Neither the name of Jonas Obrist nor the | ||
names of its contributors may be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL JONAS OBRIST BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include README.rst LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- coding: utf-8 -*- | ||
#!/usr/bin/env python | ||
import os | ||
import sys | ||
|
||
INSTALLED_APPS = [ | ||
'django.contrib.contenttypes', | ||
'django.contrib.auth', | ||
'django.contrib.sessions', | ||
'django.contrib.admin', | ||
'simple_sso.sso_server', | ||
'simple_sso', | ||
] | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': ':memory:', | ||
} | ||
} | ||
|
||
def teardown(state): | ||
from django.conf import settings | ||
# Restore the old settings. | ||
for key, value in state.items(): | ||
setattr(settings, key, value) | ||
|
||
def run_tests(): | ||
from django.conf import settings | ||
settings.configure( | ||
INSTALLED_APPS = INSTALLED_APPS, | ||
ROOT_URLCONF = 'runtests', | ||
DATABASES = DATABASES, | ||
TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner', | ||
) | ||
|
||
# Run the test suite, including the extra validation tests. | ||
from django.test.utils import get_runner | ||
TestRunner = get_runner(settings) | ||
|
||
test_runner = TestRunner(verbosity=1, interactive=False, failfast=False) | ||
failures = test_runner.run_tests(['simple_sso']) | ||
return failures | ||
|
||
|
||
if __name__ == "__main__": | ||
failures = run_tests() | ||
if failures: | ||
sys.exit(bool(failures)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import os | ||
from setuptools import setup | ||
from simple_sso import __version__ as version | ||
|
||
README = os.path.join(os.path.dirname(__file__), 'README.rst') | ||
|
||
with open(README) as fobj: | ||
long_description = fobj.read() | ||
|
||
setup(name="django-simple-sso", | ||
version=version, | ||
description="Simple SSO for Django", | ||
long_description=long_description, | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Topic :: Software Development', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
], | ||
keywords='django sso', | ||
author='Jonas Obrist', | ||
author_email='jonas.obrist@divio.ch', | ||
url='http://github.com/ojii/django-simple-sso', | ||
license='BSD', | ||
packages=['simple_sso', 'simple_sso.sso_client', 'simple_sso.sso_server'], | ||
install_requires=['Django>=1.3', 'django-load'], | ||
include_package_data=True, | ||
zip_safe=False | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = '0.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# -*- coding: utf-8 -*- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
from django.test.testcases import TestCase | ||
|
||
|
||
class SimpleSSOTests(TestCase): | ||
def test_ok(self): | ||
self.assertTrue(True) | ||
|
||
def test_fail(self): | ||
self.assertTrue(False) |