mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Add compat import test
This commit is contained in:
parent
3dc40f9572
commit
ca341ef705
|
@ -41,6 +41,7 @@ def pytest_configure():
|
|||
'django.contrib.staticfiles',
|
||||
'rest_framework',
|
||||
'rest_framework.authtoken',
|
||||
'tests.importable',
|
||||
'tests',
|
||||
),
|
||||
PASSWORD_HASHERS=(
|
||||
|
|
2
tests/importable/__init__.py
Normal file
2
tests/importable/__init__.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
from rest_framework import compat # noqa
|
13
tests/importable/test_installed.py
Normal file
13
tests/importable/test_installed.py
Normal 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')
|
Loading…
Reference in New Issue
Block a user