diff options
Diffstat (limited to 'tests/test_settings.py')
| -rw-r--r-- | tests/test_settings.py | 17 | 
1 files changed, 17 insertions, 0 deletions
| diff --git a/tests/test_settings.py b/tests/test_settings.py new file mode 100644 index 00000000..f2ff4ca1 --- /dev/null +++ b/tests/test_settings.py @@ -0,0 +1,17 @@ +from __future__ import unicode_literals +from django.test import TestCase +from rest_framework.settings import APISettings + + +class TestSettings(TestCase): +    def test_import_error_message_maintained(self): +        """ +        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 | 
