Add compat import test

This commit is contained in:
Ryan P Kilby 2017-11-06 09:56:57 -05:00
parent 3dc40f9572
commit ca341ef705
3 changed files with 16 additions and 0 deletions

View File

@ -41,6 +41,7 @@ def pytest_configure():
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'rest_framework', 'rest_framework',
'rest_framework.authtoken', 'rest_framework.authtoken',
'tests.importable',
'tests', 'tests',
), ),
PASSWORD_HASHERS=( PASSWORD_HASHERS=(

View File

@ -0,0 +1,2 @@
from rest_framework import compat # noqa

View File

@ -0,0 +1,13 @@
from django.conf import settings
from tests import importable
def test_installed():
# ensure that apps can freely import rest_framework.compat
assert 'tests.importable' in settings.INSTALLED_APPS
def test_imported():
# ensure that the __init__ hasn't been mucked with
assert hasattr(importable, 'compat')