diff --git a/docs/sections/contribute.rst b/docs/sections/contribute.rst index 2811551..d5f01af 100644 --- a/docs/sections/contribute.rst +++ b/docs/sections/contribute.rst @@ -18,8 +18,8 @@ Use `tox `_ for running tests in each of the e # Run all tests. $ tox - # Run a particular test file with Python 2.7 and Django 1.9. - $ tox -e py27-django19 oidc_provider.tests.test_authorize_endpoint + # Run with Python 2.7 and Django 1.9. + $ tox -e py27-django19 If you have a Django project properly configured with the package. Then just run tests as normal:: diff --git a/oidc_provider/runtests.py b/oidc_provider/runtests.py deleted file mode 100644 index e69de29..0000000 diff --git a/oidc_provider/tests/test_commands.py b/oidc_provider/tests/test_commands.py new file mode 100644 index 0000000..cb070ec --- /dev/null +++ b/oidc_provider/tests/test_commands.py @@ -0,0 +1,16 @@ +from django.core.management import call_command +from django.test import TestCase +from django.utils.six import StringIO + + +class CommandsTest(TestCase): + + def test_creatersakey_output(self): + out = StringIO() + call_command('creatersakey', stdout=out) + self.assertIn('RSA key successfully created', out.getvalue()) + + def test_makemigrations_output(self): + out = StringIO() + call_command('makemigrations', 'oidc_provider', stdout=out) + self.assertIn('No changes detected in app', out.getvalue()) diff --git a/oidc_provider/tests/test_creatersakey_command.py b/oidc_provider/tests/test_creatersakey_command.py deleted file mode 100644 index d9424f6..0000000 --- a/oidc_provider/tests/test_creatersakey_command.py +++ /dev/null @@ -1,12 +0,0 @@ -from django.core.management import call_command -from django.test import TestCase, override_settings -from django.utils.six import StringIO - - -class CreateRSAKeyTest(TestCase): - - @override_settings(BASE_DIR='/tmp') - def test_command_output(self): - out = StringIO() - call_command('creatersakey', stdout=out) - self.assertIn('RSA key successfully created', out.getvalue()) diff --git a/setup.py b/setup.py index ba326fd..7183e06 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup( 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], - test_suite="runtests.runtests", + test_suite='runtests.runtests', tests_require=[ 'pyjwkest==1.1.0', 'mock==2.0.0',