dont index directly on to exceptions

This commit is contained in:
Craig Blaszczyk 2015-01-08 17:58:27 +00:00
parent e2bbd8845b
commit ce5835f10a

View File

@ -35,7 +35,7 @@ class TestSettings(TestCase):
u'tuple, but got type "unicode" with value ' u'tuple, but got type "unicode" with value '
u'"rest_framework.renderers.JSONRenderer".' u'"rest_framework.renderers.JSONRenderer".'
) )
assert exc_info.value[0] == expected_error assert exc_info.value.args[0] == expected_error
def test_bad_string_setting_class_raises_warning(self): def test_bad_string_setting_class_raises_warning(self):
""" """
@ -54,4 +54,4 @@ class TestSettings(TestCase):
u'The "DEFAULT_METADATA_CLASS" setting must be a string, but got ' u'The "DEFAULT_METADATA_CLASS" setting must be a string, but got '
u'type "list" with value "[]".' u'type "list" with value "[]".'
) )
assert exc_info.value[0] == expected_error assert exc_info.value.args[0] == expected_error