2013-02-05 00:55:35 +04:00
|
|
|
from __future__ import unicode_literals
|
2015-06-25 23:55:51 +03:00
|
|
|
|
2013-01-07 16:52:20 +04:00
|
|
|
from django.test import TestCase
|
2015-06-25 23:55:51 +03:00
|
|
|
|
2014-12-15 16:18:39 +03:00
|
|
|
from rest_framework.settings import APISettings
|
2013-01-07 16:52:20 +04:00
|
|
|
|
|
|
|
|
|
|
|
class TestSettings(TestCase):
|
|
|
|
def test_import_error_message_maintained(self):
|
2014-12-15 16:18:39 +03:00
|
|
|
"""
|
|
|
|
Make sure import errors are captured and raised sensibly.
|
|
|
|
"""
|
|
|
|
settings = APISettings({
|
|
|
|
'DEFAULT_RENDERER_CLASSES': [
|
|
|
|
'tests.invalid_module.InvalidClassName'
|
|
|
|
]
|
|
|
|
})
|
|
|
|
with self.assertRaises(ImportError):
|
|
|
|
settings.DEFAULT_RENDERER_CLASSES
|