Skip to content

Commit ca341ef

Browse files
author
Ryan P Kilby
committed
Add compat import test
1 parent 3dc40f9 commit ca341ef

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def pytest_configure():
4141
'django.contrib.staticfiles',
4242
'rest_framework',
4343
'rest_framework.authtoken',
44+
'tests.importable',
4445
'tests',
4546
),
4647
PASSWORD_HASHERS=(

tests/importable/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
from rest_framework import compat # noqa

tests/importable/test_installed.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
from django.conf import settings
3+
from tests import importable
4+
5+
6+
def test_installed():
7+
# ensure that apps can freely import rest_framework.compat
8+
assert 'tests.importable' in settings.INSTALLED_APPS
9+
10+
11+
def test_imported():
12+
# ensure that the __init__ hasn't been mucked with
13+
assert hasattr(importable, 'compat')

0 commit comments

Comments
 (0)