diff --git a/.travis.yml b/.travis.yml index 2e6ed46a2..061d4c739 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ env: install: - pip install $DJANGO - pip install defusedxml==0.3 + - pip install pytest-django==2.6 - "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install oauth2==1.5.211; fi" - "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install django-oauth-plus==2.2.1; fi" - "if [[ ${TRAVIS_PYTHON_VERSION::1} != '3' ]]; then pip install django-oauth2-provider==0.2.4; fi" @@ -24,7 +25,7 @@ install: - export PYTHONPATH=. script: - - python rest_framework/runtests/runtests.py + - py.test matrix: exclude: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a7aa6fc40..ff6018b82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,7 +65,7 @@ To run the tests, clone the repository, and then: pip install -r optionals.txt # Run the tests - rest_framework/runtests/runtests.py + py.test You can also use the excellent [`tox`][tox] testing tool to run the tests against all supported versions of Python and Django. Install `tox` globally, and then simply run: diff --git a/conftest.py b/conftest.py new file mode 100644 index 000000000..7cfc77f2a --- /dev/null +++ b/conftest.py @@ -0,0 +1,85 @@ +def pytest_configure(): + from django.conf import settings + + settings.configure( + DEBUG_PROPAGATE_EXCEPTIONS=True, + DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3', + 'NAME': ':memory:'}}, + SECRET_KEY='not very secret in tests', + USE_I18N=True, + USE_L10N=True, + STATIC_URL='/static/', + ROOT_URLCONF='tests.urls', + TEMPLATE_LOADERS=( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + ), + MIDDLEWARE_CLASSES=( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + ), + INSTALLED_APPS=( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.messages', + + 'rest_framework', + 'rest_framework.authtoken', + 'tests', + 'tests.accounts', + 'tests.records', + 'tests.users', + ), + PASSWORD_HASHERS=( + 'django.contrib.auth.hashers.SHA1PasswordHasher', + 'django.contrib.auth.hashers.PBKDF2PasswordHasher', + 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher', + 'django.contrib.auth.hashers.BCryptPasswordHasher', + 'django.contrib.auth.hashers.MD5PasswordHasher', + 'django.contrib.auth.hashers.CryptPasswordHasher', + ), + ) + + try: + import oauth_provider + import oauth2 + except ImportError: + pass + else: + settings.INSTALLED_APPS += ( + 'oauth_provider', + ) + + try: + import provider + except ImportError: + pass + else: + settings.INSTALLED_APPS += ( + 'provider', + 'provider.oauth2', + ) + + # guardian is optional + try: + import guardian + except ImportError: + pass + else: + settings.ANONYMOUS_USER_ID = -1 + settings.AUTHENTICATION_BACKENDS = ( + 'django.contrib.auth.backends.ModelBackend', # default + 'guardian.backends.ObjectPermissionBackend', + ) + settings.INSTALLED_APPS += ( + 'guardian', + ) + + # Force Django to load all models + from django.db.models import get_models + get_models() diff --git a/docs/index.md b/docs/index.md index 2a4ad8859..9ad647ac9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -206,19 +206,9 @@ General guides to using REST framework. ## Development -If you want to work on REST framework itself, clone the repository, then... - -Build the docs: - - ./mkdocs.py - -Run the tests: - - ./rest_framework/runtests/runtests.py - -To run the tests against all supported configurations, first install [the tox testing tool][tox] globally, using `pip install tox`, then simply run `tox`: - - tox +See the [Contribution guidelines][contributing] for information on how to clone +the repository, run the test suite and contribute changes back to REST +Framework. ## Support diff --git a/docs/topics/contributing.md b/docs/topics/contributing.md index 5a5d1a80b..09cc00b3c 100644 --- a/docs/topics/contributing.md +++ b/docs/topics/contributing.md @@ -65,7 +65,7 @@ To run the tests, clone the repository, and then: pip install -r optionals.txt # Run the tests - rest_framework/runtests/runtests.py + py.test You can also use the excellent `[tox][tox]` testing tool to run the tests against all supported versions of Python and Django. Install `tox` globally, and then simply run: diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 000000000..bbd083ac1 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = --tb=short diff --git a/requirements.txt b/requirements.txt index 730c1d07a..360acb14d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ +-e . Django>=1.3 +pytest-django==2.6 diff --git a/rest_framework/runtests/runcoverage.py b/rest_framework/runtests/runcoverage.py deleted file mode 100755 index ce11b213e..000000000 --- a/rest_framework/runtests/runcoverage.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python -""" -Useful tool to run the test suite for rest_framework and generate a coverage report. -""" - -# http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/ -# http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/ -# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py -import os -import sys - -# fix sys path so we don't need to setup PYTHONPATH -sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) -os.environ['DJANGO_SETTINGS_MODULE'] = 'rest_framework.runtests.settings' - -from coverage import coverage - - -def main(): - """Run the tests for rest_framework and generate a coverage report.""" - - cov = coverage() - cov.erase() - cov.start() - - from django.conf import settings - from django.test.utils import get_runner - TestRunner = get_runner(settings) - - if hasattr(TestRunner, 'func_name'): - # Pre 1.2 test runners were just functions, - # and did not support the 'failfast' option. - import warnings - warnings.warn( - 'Function-based test runners are deprecated. Test runners should be classes with a run_tests() method.', - DeprecationWarning - ) - failures = TestRunner(['tests']) - else: - test_runner = TestRunner() - failures = test_runner.run_tests(['tests']) - cov.stop() - - # Discover the list of all modules that we should test coverage for - import rest_framework - - project_dir = os.path.dirname(rest_framework.__file__) - cov_files = [] - - for (path, dirs, files) in os.walk(project_dir): - # Drop tests and runtests directories from the test coverage report - if os.path.basename(path) in ['tests', 'runtests', 'migrations']: - continue - - # Drop the compat and six modules from coverage, since we're not interested in the coverage - # of modules which are specifically for resolving environment dependant imports. - # (Because we'll end up getting different coverage reports for it for each environment) - if 'compat.py' in files: - files.remove('compat.py') - - if 'six.py' in files: - files.remove('six.py') - - # Same applies to template tags module. - # This module has to include branching on Django versions, - # so it's never possible for it to have full coverage. - if 'rest_framework.py' in files: - files.remove('rest_framework.py') - - cov_files.extend([os.path.join(path, file) for file in files if file.endswith('.py')]) - - cov.report(cov_files) - if '--html' in sys.argv: - cov.html_report(cov_files, directory='coverage') - sys.exit(failures) - -if __name__ == '__main__': - main() diff --git a/rest_framework/runtests/runtests.py b/rest_framework/runtests/runtests.py deleted file mode 100755 index da36d23fc..000000000 --- a/rest_framework/runtests/runtests.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python - -# http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/ -# http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/ -# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py -import os -import sys - -# fix sys path so we don't need to setup PYTHONPATH -sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) -os.environ['DJANGO_SETTINGS_MODULE'] = 'rest_framework.runtests.settings' - -import django -from django.conf import settings -from django.test.utils import get_runner - - -def usage(): - return """ - Usage: python runtests.py [UnitTestClass].[method] - - You can pass the Class name of the `UnitTestClass` you want to test. - - Append a method name if you only want to test a specific method of that class. - """ - - -def main(): - TestRunner = get_runner(settings) - - test_runner = TestRunner() - if len(sys.argv) == 2: - test_case = '.' + sys.argv[1] - elif len(sys.argv) == 1: - test_case = '' - else: - print(usage()) - sys.exit(1) - test_module_name = 'rest_framework.tests' - if django.VERSION[0] == 1 and django.VERSION[1] < 6: - test_module_name = 'tests' - - failures = test_runner.run_tests([test_module_name + test_case]) - - sys.exit(failures) - -if __name__ == '__main__': - main() diff --git a/rest_framework/runtests/urls.py b/rest_framework/runtests/urls.py deleted file mode 100644 index ed5baeae6..000000000 --- a/rest_framework/runtests/urls.py +++ /dev/null @@ -1,7 +0,0 @@ -""" -Blank URLConf just to keep runtests.py happy. -""" -from rest_framework.compat import patterns - -urlpatterns = patterns('', -) diff --git a/rest_framework/tests/tests.py b/rest_framework/tests/tests.py deleted file mode 100644 index 554ebd1ad..000000000 --- a/rest_framework/tests/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -Force import of all modules in this package in order to get the standard test -runner to pick up the tests. Yowzers. -""" -from __future__ import unicode_literals -import os -import django - -modules = [filename.rsplit('.', 1)[0] - for filename in os.listdir(os.path.dirname(__file__)) - if filename.endswith('.py') and not filename.startswith('_')] -__test__ = dict() - -if django.VERSION < (1, 6): - for module in modules: - exec("from rest_framework.tests.%s import *" % module) diff --git a/rest_framework/tests/users/__init__.py b/rest_framework/tests/users/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/setup.py b/setup.py index 78cdb6289..2c56cd758 100755 --- a/setup.py +++ b/setup.py @@ -2,11 +2,26 @@ # -*- coding: utf-8 -*- from setuptools import setup +from setuptools.command.test import test as TestCommand import re import os import sys +# This command has been borrowed from +# https://github.com/getsentry/sentry/blob/master/setup.py +class PyTest(TestCommand): + def finalize_options(self): + TestCommand.finalize_options(self) + self.test_args = ['tests'] + self.test_suite = True + + def run_tests(self): + import pytest + errno = pytest.main(self.test_args) + sys.exit(errno) + + def get_version(package): """ Return package version as listed in `__version__` in `init.py`. @@ -62,7 +77,7 @@ setup( author_email='tom@tomchristie.com', # SEE NOTE BELOW (*) packages=get_packages('rest_framework'), package_data=get_package_data('rest_framework'), - test_suite='rest_framework.runtests.runtests.main', + cmdclass={'test': PyTest}, install_requires=[], classifiers=[ 'Development Status :: 5 - Production/Stable', diff --git a/rest_framework/runtests/__init__.py b/tests/__init__.py similarity index 100% rename from rest_framework/runtests/__init__.py rename to tests/__init__.py diff --git a/rest_framework/tests/__init__.py b/tests/accounts/__init__.py similarity index 100% rename from rest_framework/tests/__init__.py rename to tests/accounts/__init__.py diff --git a/rest_framework/tests/accounts/models.py b/tests/accounts/models.py similarity index 81% rename from rest_framework/tests/accounts/models.py rename to tests/accounts/models.py index 525e601ba..3bf4a0c3c 100644 --- a/rest_framework/tests/accounts/models.py +++ b/tests/accounts/models.py @@ -1,6 +1,6 @@ from django.db import models -from rest_framework.tests.users.models import User +from tests.users.models import User class Account(models.Model): diff --git a/rest_framework/tests/accounts/serializers.py b/tests/accounts/serializers.py similarity index 58% rename from rest_framework/tests/accounts/serializers.py rename to tests/accounts/serializers.py index a27b9ca6f..57a91b92c 100644 --- a/rest_framework/tests/accounts/serializers.py +++ b/tests/accounts/serializers.py @@ -1,7 +1,7 @@ from rest_framework import serializers -from rest_framework.tests.accounts.models import Account -from rest_framework.tests.users.serializers import UserSerializer +from tests.accounts.models import Account +from tests.users.serializers import UserSerializer class AccountSerializer(serializers.ModelSerializer): diff --git a/rest_framework/tests/description.py b/tests/description.py similarity index 100% rename from rest_framework/tests/description.py rename to tests/description.py diff --git a/rest_framework/tests/accounts/__init__.py b/tests/extras/__init__.py similarity index 100% rename from rest_framework/tests/accounts/__init__.py rename to tests/extras/__init__.py diff --git a/rest_framework/tests/extras/bad_import.py b/tests/extras/bad_import.py similarity index 100% rename from rest_framework/tests/extras/bad_import.py rename to tests/extras/bad_import.py diff --git a/rest_framework/tests/models.py b/tests/models.py similarity index 100% rename from rest_framework/tests/models.py rename to tests/models.py diff --git a/rest_framework/tests/extras/__init__.py b/tests/records/__init__.py similarity index 100% rename from rest_framework/tests/extras/__init__.py rename to tests/records/__init__.py diff --git a/rest_framework/tests/records/models.py b/tests/records/models.py similarity index 100% rename from rest_framework/tests/records/models.py rename to tests/records/models.py diff --git a/rest_framework/tests/serializers.py b/tests/serializers.py similarity index 71% rename from rest_framework/tests/serializers.py rename to tests/serializers.py index cc943c7d0..f2f85b6ea 100644 --- a/rest_framework/tests/serializers.py +++ b/tests/serializers.py @@ -1,6 +1,6 @@ from rest_framework import serializers -from rest_framework.tests.models import NullableForeignKeySource +from tests.models import NullableForeignKeySource class NullableFKSourceSerializer(serializers.ModelSerializer): diff --git a/rest_framework/runtests/settings.py b/tests/settings.py similarity index 96% rename from rest_framework/runtests/settings.py rename to tests/settings.py index 3fc0eb2f4..75f7c54b3 100644 --- a/rest_framework/runtests/settings.py +++ b/tests/settings.py @@ -79,7 +79,7 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', ) -ROOT_URLCONF = 'urls' +ROOT_URLCONF = 'tests.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". @@ -99,10 +99,10 @@ INSTALLED_APPS = ( # 'django.contrib.admindocs', 'rest_framework', 'rest_framework.authtoken', - 'rest_framework.tests', - 'rest_framework.tests.accounts', - 'rest_framework.tests.records', - 'rest_framework.tests.users', + 'tests', + 'tests.accounts', + 'tests.records', + 'tests.users', ) # OAuth is optional and won't work if there is no oauth_provider & oauth2 diff --git a/rest_framework/tests/test_authentication.py b/tests/test_authentication.py similarity index 99% rename from rest_framework/tests/test_authentication.py rename to tests/test_authentication.py index f072b81b7..4ecfef44f 100644 --- a/rest_framework/tests/test_authentication.py +++ b/tests/test_authentication.py @@ -64,7 +64,7 @@ if oauth2_provider is not None: class BasicAuthTests(TestCase): """Basic authentication""" - urls = 'rest_framework.tests.test_authentication' + urls = 'tests.test_authentication' def setUp(self): self.csrf_client = APIClient(enforce_csrf_checks=True) @@ -103,7 +103,7 @@ class BasicAuthTests(TestCase): class SessionAuthTests(TestCase): """User session authentication""" - urls = 'rest_framework.tests.test_authentication' + urls = 'tests.test_authentication' def setUp(self): self.csrf_client = APIClient(enforce_csrf_checks=True) @@ -150,7 +150,7 @@ class SessionAuthTests(TestCase): class TokenAuthTests(TestCase): """Token authentication""" - urls = 'rest_framework.tests.test_authentication' + urls = 'tests.test_authentication' def setUp(self): self.csrf_client = APIClient(enforce_csrf_checks=True) @@ -244,7 +244,7 @@ class IncorrectCredentialsTests(TestCase): class OAuthTests(TestCase): """OAuth 1.0a authentication""" - urls = 'rest_framework.tests.test_authentication' + urls = 'tests.test_authentication' def setUp(self): # these imports are here because oauth is optional and hiding them in try..except block or compat @@ -474,7 +474,7 @@ class OAuthTests(TestCase): class OAuth2Tests(TestCase): """OAuth 2.0 authentication""" - urls = 'rest_framework.tests.test_authentication' + urls = 'tests.test_authentication' def setUp(self): self.csrf_client = APIClient(enforce_csrf_checks=True) diff --git a/rest_framework/tests/test_breadcrumbs.py b/tests/test_breadcrumbs.py similarity index 98% rename from rest_framework/tests/test_breadcrumbs.py rename to tests/test_breadcrumbs.py index 41ddf2cea..78edc6032 100644 --- a/rest_framework/tests/test_breadcrumbs.py +++ b/tests/test_breadcrumbs.py @@ -36,7 +36,7 @@ urlpatterns = patterns('', class BreadcrumbTests(TestCase): """Tests the breadcrumb functionality used by the HTML renderer.""" - urls = 'rest_framework.tests.test_breadcrumbs' + urls = 'tests.test_breadcrumbs' def test_root_breadcrumbs(self): url = '/' diff --git a/rest_framework/tests/test_decorators.py b/tests/test_decorators.py similarity index 100% rename from rest_framework/tests/test_decorators.py rename to tests/test_decorators.py diff --git a/rest_framework/tests/test_description.py b/tests/test_description.py similarity index 94% rename from rest_framework/tests/test_description.py rename to tests/test_description.py index 4c03c1ded..1e481f06c 100644 --- a/rest_framework/tests/test_description.py +++ b/tests/test_description.py @@ -4,8 +4,8 @@ from __future__ import unicode_literals from django.test import TestCase from rest_framework.compat import apply_markdown, smart_text from rest_framework.views import APIView -from rest_framework.tests.description import ViewWithNonASCIICharactersInDocstring -from rest_framework.tests.description import UTF8_TEST_DOCSTRING +from .description import ViewWithNonASCIICharactersInDocstring +from .description import UTF8_TEST_DOCSTRING # We check that docstrings get nicely un-indented. DESCRIPTION = """an example docstring diff --git a/rest_framework/tests/test_fields.py b/tests/test_fields.py similarity index 99% rename from rest_framework/tests/test_fields.py rename to tests/test_fields.py index e127feef9..e65a2fb39 100644 --- a/rest_framework/tests/test_fields.py +++ b/tests/test_fields.py @@ -11,7 +11,7 @@ from django.db import models from django.test import TestCase from django.utils.datastructures import SortedDict from rest_framework import serializers -from rest_framework.tests.models import RESTFrameworkModel +from tests.models import RESTFrameworkModel class TimestampedModel(models.Model): diff --git a/rest_framework/tests/test_files.py b/tests/test_files.py similarity index 100% rename from rest_framework/tests/test_files.py rename to tests/test_files.py diff --git a/rest_framework/tests/test_filters.py b/tests/test_filters.py similarity index 99% rename from rest_framework/tests/test_filters.py rename to tests/test_filters.py index 181881865..d9d8042e2 100644 --- a/rest_framework/tests/test_filters.py +++ b/tests/test_filters.py @@ -8,7 +8,7 @@ from django.utils import unittest from rest_framework import generics, serializers, status, filters from rest_framework.compat import django_filters, patterns, url from rest_framework.test import APIRequestFactory -from rest_framework.tests.models import BasicModel +from tests.models import BasicModel factory = APIRequestFactory() @@ -243,7 +243,7 @@ class IntegrationTestDetailFiltering(CommonFilteringTestCase): """ Integration tests for filtered detail views. """ - urls = 'rest_framework.tests.test_filters' + urls = 'tests.test_filters' def _get_url(self, item): return reverse('detail-view', kwargs=dict(pk=item.pk)) @@ -612,4 +612,4 @@ class SensitiveOrderingFilterTests(TestCase): {'id': 2, username_field: 'userB'}, # PassC {'id': 3, username_field: 'userC'}, # PassA ] - ) \ No newline at end of file + ) diff --git a/rest_framework/tests/test_genericrelations.py b/tests/test_genericrelations.py similarity index 100% rename from rest_framework/tests/test_genericrelations.py rename to tests/test_genericrelations.py diff --git a/rest_framework/tests/test_generics.py b/tests/test_generics.py similarity index 99% rename from rest_framework/tests/test_generics.py rename to tests/test_generics.py index 996bd5b0e..4389994af 100644 --- a/rest_framework/tests/test_generics.py +++ b/tests/test_generics.py @@ -4,7 +4,7 @@ from django.shortcuts import get_object_or_404 from django.test import TestCase from rest_framework import generics, renderers, serializers, status from rest_framework.test import APIRequestFactory -from rest_framework.tests.models import BasicModel, Comment, SlugBasedModel +from tests.models import BasicModel, Comment, SlugBasedModel from rest_framework.compat import six factory = APIRequestFactory() diff --git a/rest_framework/tests/test_htmlrenderer.py b/tests/test_htmlrenderer.py similarity index 97% rename from rest_framework/tests/test_htmlrenderer.py rename to tests/test_htmlrenderer.py index 8957a43c7..c748fbdbb 100644 --- a/rest_framework/tests/test_htmlrenderer.py +++ b/tests/test_htmlrenderer.py @@ -42,7 +42,7 @@ urlpatterns = patterns('', class TemplateHTMLRendererTests(TestCase): - urls = 'rest_framework.tests.test_htmlrenderer' + urls = 'tests.test_htmlrenderer' def setUp(self): """ @@ -82,7 +82,7 @@ class TemplateHTMLRendererTests(TestCase): class TemplateHTMLRendererExceptionTests(TestCase): - urls = 'rest_framework.tests.test_htmlrenderer' + urls = 'tests.test_htmlrenderer' def setUp(self): """ diff --git a/rest_framework/tests/test_hyperlinkedserializers.py b/tests/test_hyperlinkedserializers.py similarity index 95% rename from rest_framework/tests/test_hyperlinkedserializers.py rename to tests/test_hyperlinkedserializers.py index 83d460435..eee179cae 100644 --- a/rest_framework/tests/test_hyperlinkedserializers.py +++ b/tests/test_hyperlinkedserializers.py @@ -5,7 +5,7 @@ from rest_framework import generics, status, serializers from rest_framework.compat import patterns, url from rest_framework.settings import api_settings from rest_framework.test import APIRequestFactory -from rest_framework.tests.models import ( +from tests.models import ( Anchor, BasicModel, ManyToManyModel, BlogPost, BlogPostComment, Album, Photo, OptionalRelationModel ) @@ -110,7 +110,7 @@ urlpatterns = patterns('', class TestBasicHyperlinkedView(TestCase): - urls = 'rest_framework.tests.test_hyperlinkedserializers' + urls = 'tests.test_hyperlinkedserializers' def setUp(self): """ @@ -147,7 +147,7 @@ class TestBasicHyperlinkedView(TestCase): class TestManyToManyHyperlinkedView(TestCase): - urls = 'rest_framework.tests.test_hyperlinkedserializers' + urls = 'tests.test_hyperlinkedserializers' def setUp(self): """ @@ -195,7 +195,7 @@ class TestManyToManyHyperlinkedView(TestCase): class TestHyperlinkedIdentityFieldLookup(TestCase): - urls = 'rest_framework.tests.test_hyperlinkedserializers' + urls = 'tests.test_hyperlinkedserializers' def setUp(self): """ @@ -225,7 +225,7 @@ class TestHyperlinkedIdentityFieldLookup(TestCase): class TestCreateWithForeignKeys(TestCase): - urls = 'rest_framework.tests.test_hyperlinkedserializers' + urls = 'tests.test_hyperlinkedserializers' def setUp(self): """ @@ -250,7 +250,7 @@ class TestCreateWithForeignKeys(TestCase): class TestCreateWithForeignKeysAndCustomSlug(TestCase): - urls = 'rest_framework.tests.test_hyperlinkedserializers' + urls = 'tests.test_hyperlinkedserializers' def setUp(self): """ @@ -275,7 +275,7 @@ class TestCreateWithForeignKeysAndCustomSlug(TestCase): class TestOptionalRelationHyperlinkedView(TestCase): - urls = 'rest_framework.tests.test_hyperlinkedserializers' + urls = 'tests.test_hyperlinkedserializers' def setUp(self): """ @@ -335,7 +335,7 @@ class TestOverriddenURLField(TestCase): class TestURLFieldNameBySettings(TestCase): - urls = 'rest_framework.tests.test_hyperlinkedserializers' + urls = 'tests.test_hyperlinkedserializers' def setUp(self): self.saved_url_field_name = api_settings.URL_FIELD_NAME @@ -360,7 +360,7 @@ class TestURLFieldNameBySettings(TestCase): class TestURLFieldNameByOptions(TestCase): - urls = 'rest_framework.tests.test_hyperlinkedserializers' + urls = 'tests.test_hyperlinkedserializers' def setUp(self): class Serializer(serializers.HyperlinkedModelSerializer): diff --git a/rest_framework/tests/test_multitable_inheritance.py b/tests/test_multitable_inheritance.py similarity index 97% rename from rest_framework/tests/test_multitable_inheritance.py rename to tests/test_multitable_inheritance.py index 00c153276..ce1bf3ea3 100644 --- a/rest_framework/tests/test_multitable_inheritance.py +++ b/tests/test_multitable_inheritance.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.db import models from django.test import TestCase from rest_framework import serializers -from rest_framework.tests.models import RESTFrameworkModel +from tests.models import RESTFrameworkModel # Models diff --git a/rest_framework/tests/test_negotiation.py b/tests/test_negotiation.py similarity index 100% rename from rest_framework/tests/test_negotiation.py rename to tests/test_negotiation.py diff --git a/rest_framework/tests/test_nullable_fields.py b/tests/test_nullable_fields.py similarity index 76% rename from rest_framework/tests/test_nullable_fields.py rename to tests/test_nullable_fields.py index 6ee55c005..33a9685f3 100644 --- a/rest_framework/tests/test_nullable_fields.py +++ b/tests/test_nullable_fields.py @@ -2,9 +2,9 @@ from django.core.urlresolvers import reverse from rest_framework.compat import patterns, url from rest_framework.test import APITestCase -from rest_framework.tests.models import NullableForeignKeySource -from rest_framework.tests.serializers import NullableFKSourceSerializer -from rest_framework.tests.views import NullableFKSourceDetail +from tests.models import NullableForeignKeySource +from tests.serializers import NullableFKSourceSerializer +from tests.views import NullableFKSourceDetail urlpatterns = patterns( @@ -18,7 +18,7 @@ class NullableForeignKeyTests(APITestCase): DRF should be able to handle nullable foreign keys when a test Client POST/PUT request is made with its own serialized object. """ - urls = 'rest_framework.tests.test_nullable_fields' + urls = 'tests.test_nullable_fields' def test_updating_object_with_null_fk(self): obj = NullableForeignKeySource(name='example', target=None) diff --git a/rest_framework/tests/test_pagination.py b/tests/test_pagination.py similarity index 99% rename from rest_framework/tests/test_pagination.py rename to tests/test_pagination.py index cadb515fa..65fa9dcd1 100644 --- a/rest_framework/tests/test_pagination.py +++ b/tests/test_pagination.py @@ -8,7 +8,7 @@ from django.utils import unittest from rest_framework import generics, status, pagination, filters, serializers from rest_framework.compat import django_filters from rest_framework.test import APIRequestFactory -from rest_framework.tests.models import BasicModel +from tests.models import BasicModel factory = APIRequestFactory() diff --git a/rest_framework/tests/test_parsers.py b/tests/test_parsers.py similarity index 100% rename from rest_framework/tests/test_parsers.py rename to tests/test_parsers.py diff --git a/rest_framework/tests/test_permissions.py b/tests/test_permissions.py similarity index 98% rename from rest_framework/tests/test_permissions.py rename to tests/test_permissions.py index 6e3a63034..a2cb0c362 100644 --- a/rest_framework/tests/test_permissions.py +++ b/tests/test_permissions.py @@ -7,7 +7,7 @@ from rest_framework import generics, status, permissions, authentication, HTTP_H from rest_framework.compat import guardian, get_model_name from rest_framework.filters import DjangoObjectPermissionsFilter from rest_framework.test import APIRequestFactory -from rest_framework.tests.models import BasicModel +from tests.models import BasicModel import base64 factory = APIRequestFactory() @@ -187,8 +187,7 @@ class ObjectPermissionsIntegrationTests(TestCase): """ Integration tests for the object level permissions API. """ - @classmethod - def setUpClass(cls): + def setUp(self): from guardian.shortcuts import assign_perm # create users @@ -215,21 +214,13 @@ class ObjectPermissionsIntegrationTests(TestCase): assign_perm(perm, everyone) everyone.user_set.add(*users.values()) - cls.perms = perms - cls.users = users - - def setUp(self): - from guardian.shortcuts import assign_perm - perms = self.perms - users = self.users - # appropriate object level permissions readers = Group.objects.create(name='readers') writers = Group.objects.create(name='writers') deleters = Group.objects.create(name='deleters') model = BasicPermModel.objects.create(text='foo') - + assign_perm(perms['view'], readers, model) assign_perm(perms['change'], writers, model) assign_perm(perms['delete'], deleters, model) diff --git a/rest_framework/tests/test_relations.py b/tests/test_relations.py similarity index 97% rename from rest_framework/tests/test_relations.py rename to tests/test_relations.py index f52e0e1e5..bfc8d487e 100644 --- a/rest_framework/tests/test_relations.py +++ b/tests/test_relations.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals from django.db import models from django.test import TestCase from rest_framework import serializers -from rest_framework.tests.models import BlogPost +from tests.models import BlogPost class NullModel(models.Model): @@ -105,7 +105,7 @@ class RelatedFieldSourceTests(TestCase): Check that the exception message are correct if the source field doesn't exist. """ - from rest_framework.tests.models import ManyToManySource + from tests.models import ManyToManySource class Meta: model = ManyToManySource attrs = { diff --git a/rest_framework/tests/test_relations_hyperlink.py b/tests/test_relations_hyperlink.py similarity index 98% rename from rest_framework/tests/test_relations_hyperlink.py rename to tests/test_relations_hyperlink.py index 3c4d39af6..98f68d29f 100644 --- a/rest_framework/tests/test_relations_hyperlink.py +++ b/tests/test_relations_hyperlink.py @@ -3,7 +3,7 @@ from django.test import TestCase from rest_framework import serializers from rest_framework.compat import patterns, url from rest_framework.test import APIRequestFactory -from rest_framework.tests.models import ( +from tests.models import ( BlogPost, ManyToManyTarget, ManyToManySource, ForeignKeyTarget, ForeignKeySource, NullableForeignKeySource, OneToOneTarget, NullableOneToOneSource @@ -71,7 +71,7 @@ class NullableOneToOneTargetSerializer(serializers.HyperlinkedModelSerializer): # TODO: Add test that .data cannot be accessed prior to .is_valid class HyperlinkedManyToManyTests(TestCase): - urls = 'rest_framework.tests.test_relations_hyperlink' + urls = 'tests.test_relations_hyperlink' def setUp(self): for idx in range(1, 4): @@ -179,7 +179,7 @@ class HyperlinkedManyToManyTests(TestCase): class HyperlinkedForeignKeyTests(TestCase): - urls = 'rest_framework.tests.test_relations_hyperlink' + urls = 'tests.test_relations_hyperlink' def setUp(self): target = ForeignKeyTarget(name='target-1') @@ -307,7 +307,7 @@ class HyperlinkedForeignKeyTests(TestCase): class HyperlinkedNullableForeignKeyTests(TestCase): - urls = 'rest_framework.tests.test_relations_hyperlink' + urls = 'tests.test_relations_hyperlink' def setUp(self): target = ForeignKeyTarget(name='target-1') @@ -435,7 +435,7 @@ class HyperlinkedNullableForeignKeyTests(TestCase): class HyperlinkedNullableOneToOneTests(TestCase): - urls = 'rest_framework.tests.test_relations_hyperlink' + urls = 'tests.test_relations_hyperlink' def setUp(self): target = OneToOneTarget(name='target-1') @@ -458,7 +458,7 @@ class HyperlinkedNullableOneToOneTests(TestCase): # Regression tests for #694 (`source` attribute on related fields) class HyperlinkedRelatedFieldSourceTests(TestCase): - urls = 'rest_framework.tests.test_relations_hyperlink' + urls = 'tests.test_relations_hyperlink' def test_related_manager_source(self): """ diff --git a/rest_framework/tests/test_relations_nested.py b/tests/test_relations_nested.py similarity index 100% rename from rest_framework/tests/test_relations_nested.py rename to tests/test_relations_nested.py diff --git a/rest_framework/tests/test_relations_pk.py b/tests/test_relations_pk.py similarity index 99% rename from rest_framework/tests/test_relations_pk.py rename to tests/test_relations_pk.py index 3815afdd8..ff59b250a 100644 --- a/rest_framework/tests/test_relations_pk.py +++ b/tests/test_relations_pk.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.db import models from django.test import TestCase from rest_framework import serializers -from rest_framework.tests.models import ( +from tests.models import ( BlogPost, ManyToManyTarget, ManyToManySource, ForeignKeyTarget, ForeignKeySource, NullableForeignKeySource, OneToOneTarget, NullableOneToOneSource, ) diff --git a/rest_framework/tests/test_relations_slug.py b/tests/test_relations_slug.py similarity index 99% rename from rest_framework/tests/test_relations_slug.py rename to tests/test_relations_slug.py index 435c821cf..97ebf23a1 100644 --- a/rest_framework/tests/test_relations_slug.py +++ b/tests/test_relations_slug.py @@ -1,6 +1,6 @@ from django.test import TestCase from rest_framework import serializers -from rest_framework.tests.models import NullableForeignKeySource, ForeignKeySource, ForeignKeyTarget +from tests.models import NullableForeignKeySource, ForeignKeySource, ForeignKeyTarget class ForeignKeyTargetSerializer(serializers.ModelSerializer): diff --git a/rest_framework/tests/test_renderers.py b/tests/test_renderers.py similarity index 99% rename from rest_framework/tests/test_renderers.py rename to tests/test_renderers.py index 0f3432c99..b41cff397 100644 --- a/rest_framework/tests/test_renderers.py +++ b/tests/test_renderers.py @@ -152,7 +152,7 @@ class RendererEndToEndTests(TestCase): End-to-end testing of renderers using an RendererMixin on a generic view. """ - urls = 'rest_framework.tests.test_renderers' + urls = 'tests.test_renderers' def test_default_renderer_serializes_content(self): """If the Accept header is not set the default renderer should serialize the response.""" @@ -387,7 +387,7 @@ class JSONPRendererTests(TestCase): Tests specific to the JSONP Renderer """ - urls = 'rest_framework.tests.test_renderers' + urls = 'tests.test_renderers' def test_without_callback_with_json_renderer(self): """ @@ -571,7 +571,7 @@ class CacheRenderTest(TestCase): Tests specific to caching responses """ - urls = 'rest_framework.tests.test_renderers' + urls = 'tests.test_renderers' cache_key = 'just_a_cache_key' diff --git a/rest_framework/tests/test_request.py b/tests/test_request.py similarity index 99% rename from rest_framework/tests/test_request.py rename to tests/test_request.py index c0b50f330..0a9355f0b 100644 --- a/rest_framework/tests/test_request.py +++ b/tests/test_request.py @@ -278,7 +278,7 @@ urlpatterns = patterns('', class TestContentParsingWithAuthentication(TestCase): - urls = 'rest_framework.tests.test_request' + urls = 'tests.test_request' def setUp(self): self.csrf_client = APIClient(enforce_csrf_checks=True) diff --git a/rest_framework/tests/test_response.py b/tests/test_response.py similarity index 97% rename from rest_framework/tests/test_response.py rename to tests/test_response.py index eea3c6418..41c0f49d8 100644 --- a/rest_framework/tests/test_response.py +++ b/tests/test_response.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals from django.test import TestCase -from rest_framework.tests.models import BasicModel, BasicModelSerializer +from tests.models import BasicModel, BasicModelSerializer from rest_framework.compat import patterns, url, include from rest_framework.response import Response from rest_framework.views import APIView @@ -118,7 +118,7 @@ class RendererIntegrationTests(TestCase): End-to-end testing of renderers using an ResponseMixin on a generic view. """ - urls = 'rest_framework.tests.test_response' + urls = 'tests.test_response' def test_default_renderer_serializes_content(self): """If the Accept header is not set the default renderer should serialize the response.""" @@ -198,7 +198,7 @@ class Issue122Tests(TestCase): """ Tests that covers #122. """ - urls = 'rest_framework.tests.test_response' + urls = 'tests.test_response' def test_only_html_renderer(self): """ @@ -218,7 +218,7 @@ class Issue467Tests(TestCase): Tests for #467 """ - urls = 'rest_framework.tests.test_response' + urls = 'tests.test_response' def test_form_has_label_and_help_text(self): resp = self.client.get('/html_new_model') @@ -232,7 +232,7 @@ class Issue807Tests(TestCase): Covers #807 """ - urls = 'rest_framework.tests.test_response' + urls = 'tests.test_response' def test_does_not_append_charset_by_default(self): """ diff --git a/rest_framework/tests/test_reverse.py b/tests/test_reverse.py similarity index 93% rename from rest_framework/tests/test_reverse.py rename to tests/test_reverse.py index 690a30b11..3d14a28f5 100644 --- a/rest_framework/tests/test_reverse.py +++ b/tests/test_reverse.py @@ -19,7 +19,7 @@ class ReverseTests(TestCase): """ Tests for fully qualified URLs when using `reverse`. """ - urls = 'rest_framework.tests.test_reverse' + urls = 'tests.test_reverse' def test_reversed_urls_are_fully_qualified(self): request = factory.get('/view') diff --git a/rest_framework/tests/test_routers.py b/tests/test_routers.py similarity index 98% rename from rest_framework/tests/test_routers.py rename to tests/test_routers.py index e723f7d45..084c0e277 100644 --- a/rest_framework/tests/test_routers.py +++ b/tests/test_routers.py @@ -72,7 +72,7 @@ class TestCustomLookupFields(TestCase): """ Ensure that custom lookup fields are correctly routed. """ - urls = 'rest_framework.tests.test_routers' + urls = 'tests.test_routers' def setUp(self): class NoteSerializer(serializers.HyperlinkedModelSerializer): @@ -91,7 +91,7 @@ class TestCustomLookupFields(TestCase): self.router = SimpleRouter() self.router.register(r'notes', NoteViewSet) - from rest_framework.tests import test_routers + from tests import test_routers urls = getattr(test_routers, 'urlpatterns') urls += patterns('', url(r'^', include(self.router.urls)), diff --git a/rest_framework/tests/test_serializer.py b/tests/test_serializer.py similarity index 99% rename from rest_framework/tests/test_serializer.py rename to tests/test_serializer.py index 6b1e333e4..18484afeb 100644 --- a/rest_framework/tests/test_serializer.py +++ b/tests/test_serializer.py @@ -6,10 +6,10 @@ from django.test import TestCase from django.utils.datastructures import MultiValueDict from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers, fields, relations -from rest_framework.tests.models import (HasPositiveIntegerAsChoice, Album, ActionItem, Anchor, BasicModel, +from tests.models import (HasPositiveIntegerAsChoice, Album, ActionItem, Anchor, BasicModel, BlankFieldModel, BlogPost, BlogPostComment, Book, CallableDefaultValueModel, DefaultValueModel, ManyToManyModel, Person, ReadOnlyManyToManyModel, Photo, RESTFrameworkModel) -from rest_framework.tests.models import BasicModelSerializer +from tests.models import BasicModelSerializer import datetime import pickle @@ -1034,7 +1034,7 @@ class RelatedTraversalTest(TestCase): """ If a component of the dotted.source is None, return None for the field. """ - from rest_framework.tests.models import NullableForeignKeySource + from tests.models import NullableForeignKeySource instance = NullableForeignKeySource.objects.create(name='Source with null FK') class NullableSourceSerializer(serializers.Serializer): diff --git a/rest_framework/tests/test_serializer_bulk_update.py b/tests/test_serializer_bulk_update.py similarity index 100% rename from rest_framework/tests/test_serializer_bulk_update.py rename to tests/test_serializer_bulk_update.py diff --git a/rest_framework/tests/test_serializer_empty.py b/tests/test_serializer_empty.py similarity index 100% rename from rest_framework/tests/test_serializer_empty.py rename to tests/test_serializer_empty.py diff --git a/rest_framework/tests/test_serializer_import.py b/tests/test_serializer_import.py similarity index 90% rename from rest_framework/tests/test_serializer_import.py rename to tests/test_serializer_import.py index 9f30a7ffa..3b8ff4b3c 100644 --- a/rest_framework/tests/test_serializer_import.py +++ b/tests/test_serializer_import.py @@ -1,7 +1,7 @@ from django.test import TestCase from rest_framework import serializers -from rest_framework.tests.accounts.serializers import AccountSerializer +from tests.accounts.serializers import AccountSerializer class ImportingModelSerializerTests(TestCase): diff --git a/rest_framework/tests/test_serializer_nested.py b/tests/test_serializer_nested.py similarity index 100% rename from rest_framework/tests/test_serializer_nested.py rename to tests/test_serializer_nested.py diff --git a/rest_framework/tests/test_serializers.py b/tests/test_serializers.py similarity index 94% rename from rest_framework/tests/test_serializers.py rename to tests/test_serializers.py index 082a400ca..675477833 100644 --- a/rest_framework/tests/test_serializers.py +++ b/tests/test_serializers.py @@ -2,7 +2,7 @@ from django.db import models from django.test import TestCase from rest_framework.serializers import _resolve_model -from rest_framework.tests.models import BasicModel +from tests.models import BasicModel class ResolveModelTests(TestCase): diff --git a/rest_framework/tests/test_settings.py b/tests/test_settings.py similarity index 83% rename from rest_framework/tests/test_settings.py rename to tests/test_settings.py index 857375c21..e29fc34aa 100644 --- a/rest_framework/tests/test_settings.py +++ b/tests/test_settings.py @@ -10,13 +10,13 @@ class TestSettings(TestCase): def test_non_import_errors(self): """Make sure other errors aren't suppressed.""" - settings = APISettings({'DEFAULT_MODEL_SERIALIZER_CLASS': 'rest_framework.tests.extras.bad_import.ModelSerializer'}, DEFAULTS, IMPORT_STRINGS) + settings = APISettings({'DEFAULT_MODEL_SERIALIZER_CLASS': 'tests.extras.bad_import.ModelSerializer'}, DEFAULTS, IMPORT_STRINGS) with self.assertRaises(ValueError): settings.DEFAULT_MODEL_SERIALIZER_CLASS def test_import_error_message_maintained(self): """Make sure real import errors are captured and raised sensibly.""" - settings = APISettings({'DEFAULT_MODEL_SERIALIZER_CLASS': 'rest_framework.tests.extras.not_here.ModelSerializer'}, DEFAULTS, IMPORT_STRINGS) + settings = APISettings({'DEFAULT_MODEL_SERIALIZER_CLASS': 'tests.extras.not_here.ModelSerializer'}, DEFAULTS, IMPORT_STRINGS) with self.assertRaises(ImportError) as cm: settings.DEFAULT_MODEL_SERIALIZER_CLASS self.assertTrue('ImportError' in str(cm.exception)) diff --git a/rest_framework/tests/test_status.py b/tests/test_status.py similarity index 100% rename from rest_framework/tests/test_status.py rename to tests/test_status.py diff --git a/rest_framework/tests/test_templatetags.py b/tests/test_templatetags.py similarity index 100% rename from rest_framework/tests/test_templatetags.py rename to tests/test_templatetags.py diff --git a/rest_framework/tests/test_testing.py b/tests/test_testing.py similarity index 99% rename from rest_framework/tests/test_testing.py rename to tests/test_testing.py index 71bd8b552..8c6086a29 100644 --- a/rest_framework/tests/test_testing.py +++ b/tests/test_testing.py @@ -35,7 +35,7 @@ urlpatterns = patterns('', class TestAPITestClient(TestCase): - urls = 'rest_framework.tests.test_testing' + urls = 'tests.test_testing' def setUp(self): self.client = APIClient() diff --git a/rest_framework/tests/test_throttling.py b/tests/test_throttling.py similarity index 100% rename from rest_framework/tests/test_throttling.py rename to tests/test_throttling.py diff --git a/rest_framework/tests/test_urlpatterns.py b/tests/test_urlpatterns.py similarity index 100% rename from rest_framework/tests/test_urlpatterns.py rename to tests/test_urlpatterns.py diff --git a/rest_framework/tests/test_validation.py b/tests/test_validation.py similarity index 100% rename from rest_framework/tests/test_validation.py rename to tests/test_validation.py diff --git a/rest_framework/tests/test_views.py b/tests/test_views.py similarity index 100% rename from rest_framework/tests/test_views.py rename to tests/test_views.py diff --git a/rest_framework/tests/test_write_only_fields.py b/tests/test_write_only_fields.py similarity index 100% rename from rest_framework/tests/test_write_only_fields.py rename to tests/test_write_only_fields.py diff --git a/tests/urls.py b/tests/urls.py new file mode 100644 index 000000000..62cad3395 --- /dev/null +++ b/tests/urls.py @@ -0,0 +1,6 @@ +""" +Blank URLConf just to keep the test suite happy +""" +from rest_framework.compat import patterns + +urlpatterns = patterns('') diff --git a/rest_framework/tests/records/__init__.py b/tests/users/__init__.py similarity index 100% rename from rest_framework/tests/records/__init__.py rename to tests/users/__init__.py diff --git a/rest_framework/tests/users/models.py b/tests/users/models.py similarity index 100% rename from rest_framework/tests/users/models.py rename to tests/users/models.py diff --git a/rest_framework/tests/users/serializers.py b/tests/users/serializers.py similarity index 71% rename from rest_framework/tests/users/serializers.py rename to tests/users/serializers.py index da4965540..4893ddb34 100644 --- a/rest_framework/tests/users/serializers.py +++ b/tests/users/serializers.py @@ -1,6 +1,6 @@ from rest_framework import serializers -from rest_framework.tests.users.models import User +from tests.users.models import User class UserSerializer(serializers.ModelSerializer): diff --git a/rest_framework/tests/views.py b/tests/views.py similarity index 59% rename from rest_framework/tests/views.py rename to tests/views.py index 3917b74a9..55935e924 100644 --- a/rest_framework/tests/views.py +++ b/tests/views.py @@ -1,6 +1,6 @@ from rest_framework import generics -from rest_framework.tests.models import NullableForeignKeySource -from rest_framework.tests.serializers import NullableFKSourceSerializer +from .models import NullableForeignKeySource +from .serializers import NullableFKSourceSerializer class NullableFKSourceDetail(generics.RetrieveUpdateDestroyAPIView): diff --git a/tox.ini b/tox.ini index 77766d20b..2fe39f120 100644 --- a/tox.ini +++ b/tox.ini @@ -3,19 +3,21 @@ downloadcache = {toxworkdir}/cache/ envlist = py3.3-django1.6,py3.2-django1.6,py2.7-django1.6,py2.6-django1.6,py3.3-django1.5,py3.2-django1.5,py2.7-django1.5,py2.6-django1.5,py2.7-django1.4,py2.6-django1.4,py2.7-django1.3,py2.6-django1.3 [testenv] -commands = {envpython} rest_framework/runtests/runtests.py +commands = py.test -q [testenv:py3.3-django1.6] basepython = python3.3 deps = Django==1.6 django-filter==0.6a1 defusedxml==0.3 + pytest-django==2.6 [testenv:py3.2-django1.6] basepython = python3.2 deps = Django==1.6 django-filter==0.6a1 defusedxml==0.3 + pytest-django==2.6 [testenv:py2.7-django1.6] basepython = python2.7 @@ -26,6 +28,7 @@ deps = Django==1.6 oauth2==1.5.211 django-oauth2-provider==0.2.4 django-guardian==1.1.1 + pytest-django==2.6 [testenv:py2.6-django1.6] basepython = python2.6 @@ -36,18 +39,21 @@ deps = Django==1.6 oauth2==1.5.211 django-oauth2-provider==0.2.4 django-guardian==1.1.1 + pytest-django==2.6 [testenv:py3.3-django1.5] basepython = python3.3 deps = django==1.5.5 django-filter==0.6a1 defusedxml==0.3 + pytest-django==2.6 [testenv:py3.2-django1.5] basepython = python3.2 deps = django==1.5.5 django-filter==0.6a1 defusedxml==0.3 + pytest-django==2.6 [testenv:py2.7-django1.5] basepython = python2.7 @@ -58,6 +64,7 @@ deps = django==1.5.5 oauth2==1.5.211 django-oauth2-provider==0.2.3 django-guardian==1.1.1 + pytest-django==2.6 [testenv:py2.6-django1.5] basepython = python2.6 @@ -68,6 +75,7 @@ deps = django==1.5.5 oauth2==1.5.211 django-oauth2-provider==0.2.3 django-guardian==1.1.1 + pytest-django==2.6 [testenv:py2.7-django1.4] basepython = python2.7 @@ -78,6 +86,7 @@ deps = django==1.4.10 oauth2==1.5.211 django-oauth2-provider==0.2.3 django-guardian==1.1.1 + pytest-django==2.6 [testenv:py2.6-django1.4] basepython = python2.6 @@ -88,6 +97,7 @@ deps = django==1.4.10 oauth2==1.5.211 django-oauth2-provider==0.2.3 django-guardian==1.1.1 + pytest-django==2.6 [testenv:py2.7-django1.3] basepython = python2.7 @@ -98,6 +108,7 @@ deps = django==1.3.5 oauth2==1.5.211 django-oauth2-provider==0.2.3 django-guardian==1.1.1 + pytest-django==2.6 [testenv:py2.6-django1.3] basepython = python2.6 @@ -108,3 +119,4 @@ deps = django==1.3.5 oauth2==1.5.211 django-oauth2-provider==0.2.3 django-guardian==1.1.1 + pytest-django==2.6